Commit 6c0246a9 authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

gfs2: Cease delete work during unmount

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: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 1c900151
...@@ -1022,6 +1022,8 @@ static void delete_work_func(struct work_struct *work) ...@@ -1022,6 +1022,8 @@ static void delete_work_func(struct work_struct *work)
* step entirely. * step entirely.
*/ */
if (gfs2_try_evict(gl)) { if (gfs2_try_evict(gl)) {
if (test_bit(SDF_DEACTIVATING, &sdp->sd_flags))
goto out;
if (gfs2_queue_verify_evict(gl)) if (gfs2_queue_verify_evict(gl))
return; return;
} }
...@@ -1033,6 +1035,7 @@ static void delete_work_func(struct work_struct *work) ...@@ -1033,6 +1035,7 @@ static void delete_work_func(struct work_struct *work)
GFS2_BLKST_UNLINKED); GFS2_BLKST_UNLINKED);
if (IS_ERR(inode)) { if (IS_ERR(inode)) {
if (PTR_ERR(inode) == -EAGAIN && if (PTR_ERR(inode) == -EAGAIN &&
!test_bit(SDF_DEACTIVATING, &sdp->sd_flags) &&
gfs2_queue_verify_evict(gl)) gfs2_queue_verify_evict(gl))
return; return;
} else { } else {
......
...@@ -648,7 +648,8 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote) ...@@ -648,7 +648,8 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
struct gfs2_inode *ip = gl->gl_object; struct gfs2_inode *ip = gl->gl_object;
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
if (!remote || sb_rdonly(sdp->sd_vfs)) if (!remote || sb_rdonly(sdp->sd_vfs) ||
test_bit(SDF_DEACTIVATING, &sdp->sd_flags))
return; return;
if (gl->gl_demote_state == LM_ST_UNLOCKED && if (gl->gl_demote_state == LM_ST_UNLOCKED &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment