Skip to content

Commit 53af80c

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: Fix BUG during unmount after file system withdraw
Before this patch, when the logd daemon was forced to withdraw, it would try to request its journal be recovered by another cluster node. However, in single-user cases with lock_nolock, there are no other nodes to recover the journal. Function signal_our_withdraw() was recognizing the lock_nolock situation, but not until after it had evicted its journal inode. Since the journal descriptor that points to the inode was never removed from the master list, when the unmount occurred, it did another iput on the evicted inode, which resulted in a BUG_ON(inode->i_state & I_CLEAR). This patch moves the check for this situation earlier in function signal_our_withdraw(), which avoids the extra iput, so the unmount may happen normally. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent a8b7528 commit 53af80c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/gfs2/util.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
119119
if (!sb_rdonly(sdp->sd_vfs))
120120
ret = gfs2_make_fs_ro(sdp);
121121

122+
if (sdp->sd_lockstruct.ls_ops->lm_lock == NULL) { /* lock_nolock */
123+
if (!ret)
124+
ret = -EIO;
125+
clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
126+
goto skip_recovery;
127+
}
122128
/*
123129
* Drop the glock for our journal so another node can recover it.
124130
*/
@@ -159,10 +165,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
159165
wait_on_bit(&gl->gl_flags, GLF_FREEING, TASK_UNINTERRUPTIBLE);
160166
}
161167

162-
if (sdp->sd_lockstruct.ls_ops->lm_lock == NULL) { /* lock_nolock */
163-
clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
164-
goto skip_recovery;
165-
}
166168
/*
167169
* Dequeue the "live" glock, but keep a reference so it's never freed.
168170
*/

0 commit comments

Comments
 (0)