]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Wipe jdata and ail1 in gfs2_journal_wipe, formerly gfs2_meta_wipe
authorBob Peterson <rpeterso@redhat.com>
Wed, 22 Jul 2020 15:27:50 +0000 (10:27 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 15 Oct 2020 12:29:03 +0000 (14:29 +0200)
commitc0eebf677c886d4c94a706ca2f92e806f6f93266
treed6b7b52882431b8a2b6d7ca04590e33e6637e4b6
parent7c5e50d88a28b3130cbf9b3ac0decefdf0308b50
gfs2: Wipe jdata and ail1 in gfs2_journal_wipe, formerly gfs2_meta_wipe

Before this patch, when blocks were freed, it called gfs2_meta_wipe to
take the metadata out of the pending journal blocks. It did this mostly
by calling another function called gfs2_remove_from_journal. This is
shortsighted because it does not do anything with jdata blocks which
may also be in the journal.

This patch expands the function so that it wipes out jdata blocks from
the journal as well, and it wipes it from the ail1 list if it hasn't
been written back yet. Since it now processes jdata blocks as well,
the function has been renamed from gfs2_meta_wipe to gfs2_journal_wipe.

New function gfs2_ail1_wipe wants a static view of the ail list, so it
locks the sd_ail_lock when removing items. To accomplish this, function
gfs2_remove_from_journal no longer locks the sd_ail_lock, and it's now
the caller's responsibility to do so.

I was going to make sd_ail_lock locking conditional, but the practice is
generally frowned upon. For details, see: https://lwn.net/Articles/109066/

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/aops.c
fs/gfs2/log.c
fs/gfs2/log.h
fs/gfs2/meta_io.c
fs/gfs2/meta_io.h
fs/gfs2/rgrp.c