]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: fix withdraw sequence deadlock
authorBob Peterson <rpeterso@redhat.com>
Wed, 22 Apr 2020 19:14:30 +0000 (14:14 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 6 May 2020 19:25:26 +0000 (21:25 +0200)
commit92f06b89d0530219a7e6de9ac215da71e3b3ccb4
treef654df998850da2390db3900214cc670a114b24f
parent9b8057e7f937f20763a90a8fc2333168af101732
gfs2: fix withdraw sequence deadlock

After a gfs2 file system withdraw, any attempt to read metadata is
automatically rejected by function gfs2_meta_read() except for reads
of the journal inode. This turns out to be a problem because function
signal_our_withdraw() repeatedly calls check_journal_clean() which reads
the metadata (both its dinode and indirect blocks) to see if the entire
journal is mapped. The dinode read works, but reading the indirect blocks
returns -EIO which gets sent back up and causes a consistency error.
This results in withdraw-from-withdraw, which becomes a deadlock.

This patch changes the test in gfs2_meta_read() to allow all metadata
reads for the journal. Instead of checking the journal block, it now
checks for the journal inode glock which is the same for all blocks in
the journal. This allows check_journal_clean() to properly check the
journal without trying to withdraw recursively.

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