summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2017-06-30 14:47:15 +0200
committerBob Peterson <rpeterso@redhat.com>2017-07-05 14:20:24 +0200
commit4fd1a5795214bc6405f14691c1344ae8c3f17215 (patch)
treeac0d1a48b243c6e27b40460503bc99290fa3c564 /fs/gfs2/super.c
parentGFS2: Eliminate vestigial sd_log_flush_wrapped (diff)
downloadlinux-4fd1a5795214bc6405f14691c1344ae8c3f17215.tar.xz
linux-4fd1a5795214bc6405f14691c1344ae8c3f17215.zip
gfs2: Get rid of flush_delayed_work in gfs2_evict_inode
So far, gfs2_evict_inode clears gl->gl_object and then flushes the glock work queue to make sure that inode glops which dereference gl->gl_object have finished running before the inode is destroyed. However, flushing the work queue may do more work than needed, and in particular, it may call into DLM, which we want to avoid here. Use a bit lock (GIF_GLOP_PENDING) to synchronize between the inode glops and gfs2_evict_inode instead to get rid of the flushing. In addition, flush the work queues of existing glocks before reusing them for new inodes to get those glocks into a known state: the glock state engine currently doesn't handle glock re-appropriation correctly. (We may be able to fix the glock state engine instead later.) Based on a patch by Steven Whitehouse <swhiteho@redhat.com>. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to '')
-rw-r--r--fs/gfs2/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 29b0473f6e74..7d12c1232c42 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1631,8 +1631,8 @@ out:
gfs2_ordered_del_inode(ip);
clear_inode(inode);
gfs2_dir_hash_inval(ip);
- ip->i_gl->gl_object = NULL;
- flush_delayed_work(&ip->i_gl->gl_work);
+ glock_set_object(ip->i_gl, NULL);
+ wait_on_bit_io(&ip->i_flags, GIF_GLOP_PENDING, TASK_UNINTERRUPTIBLE);
gfs2_glock_add_to_lru(ip->i_gl);
gfs2_glock_put(ip->i_gl);
ip->i_gl = NULL;