Skip to content

Commit 18c4ca8

Browse files
committed
gfs2: Cease delete work during unmount
jira LE-2169 Rebuild_History Non-Buildable kernel-4.18.0-553.27.1.el8_10 commit-author Bob Peterson <rpeterso@redhat.com> commit 6c0246a Add a check to delete_work_func() so that it quits when it finds that the filesystem is deactivating. This speeds up the delete workqueue draining in gfs2_kill_sb(). In addition, make sure that iopen_go_callback() won't queue any new delete work while the filesystem is deactivating. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> (cherry picked from commit 6c0246a) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 3d763b5 commit 18c4ca8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

fs/gfs2/glock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ static void delete_work_func(struct work_struct *work)
10151015
* step entirely.
10161016
*/
10171017
if (gfs2_try_evict(gl)) {
1018+
if (test_bit(SDF_DEACTIVATING, &sdp->sd_flags))
1019+
goto out;
10181020
if (gfs2_queue_verify_evict(gl))
10191021
return;
10201022
}
@@ -1026,6 +1028,7 @@ static void delete_work_func(struct work_struct *work)
10261028
GFS2_BLKST_UNLINKED);
10271029
if (IS_ERR(inode)) {
10281030
if (PTR_ERR(inode) == -EAGAIN &&
1031+
!test_bit(SDF_DEACTIVATING, &sdp->sd_flags) &&
10291032
gfs2_queue_verify_evict(gl))
10301033
return;
10311034
} else {

fs/gfs2/glops.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
627627
struct gfs2_inode *ip = gl->gl_object;
628628
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
629629

630-
if (!remote || sb_rdonly(sdp->sd_vfs))
630+
if (!remote || sb_rdonly(sdp->sd_vfs) ||
631+
test_bit(SDF_DEACTIVATING, &sdp->sd_flags))
631632
return;
632633

633634
if (gl->gl_demote_state == LM_ST_UNLOCKED &&

0 commit comments

Comments
 (0)