aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2017-06-30 08:47:15 -0400
committerBob Peterson <rpeterso@redhat.com>2017-07-05 08:20:24 -0400
commit4fd1a5795214bc6405f14691c1344ae8c3f17215 (patch)
treeac0d1a48b243c6e27b40460503bc99290fa3c564 /fs/gfs2/inode.c
parent722f6f62a563108dc0f311bd86120b8fbfa0c6df (diff)
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 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 9f605ea4810c..912d4e66fabc 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -144,7 +144,8 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
144 error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl); 144 error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl);
145 if (unlikely(error)) 145 if (unlikely(error))
146 goto fail; 146 goto fail;
147 ip->i_gl->gl_object = ip; 147 flush_delayed_work(&ip->i_gl->gl_work);
148 glock_set_object(ip->i_gl, ip);
148 149
149 error = gfs2_glock_get(sdp, no_addr, &gfs2_iopen_glops, CREATE, &io_gl); 150 error = gfs2_glock_get(sdp, no_addr, &gfs2_iopen_glops, CREATE, &io_gl);
150 if (unlikely(error)) 151 if (unlikely(error))
@@ -173,8 +174,8 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
173 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh); 174 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
174 if (unlikely(error)) 175 if (unlikely(error))
175 goto fail_put; 176 goto fail_put;
176 177 flush_delayed_work(&ip->i_iopen_gh.gh_gl->gl_work);
177 ip->i_iopen_gh.gh_gl->gl_object = ip; 178 glock_set_object(ip->i_iopen_gh.gh_gl, ip);
178 gfs2_glock_put(io_gl); 179 gfs2_glock_put(io_gl);
179 io_gl = NULL; 180 io_gl = NULL;
180 181