Skip to content

Commit ac91558

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
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 <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 8f3d9f3 commit ac91558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/gfs2/meta_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
252252
int num = 0;
253253

254254
if (unlikely(gfs2_withdrawn(sdp)) &&
255-
(!sdp->sd_jdesc || (blkno != sdp->sd_jdesc->jd_no_addr))) {
255+
(!sdp->sd_jdesc || gl != sdp->sd_jinode_gl)) {
256256
*bhp = NULL;
257257
return -EIO;
258258
}

0 commit comments

Comments
 (0)