* [Cluster-devel] [GFS2 PATCH] GFS2: Don't cache iopen glocks [not found] <348496101.30641165.1369842657387.JavaMail.root@redhat.com> @ 2013-05-29 15:51 ` Bob Peterson 2013-06-03 13:41 ` Steven Whitehouse 0 siblings, 1 reply; 2+ messages in thread From: Bob Peterson @ 2013-05-29 15:51 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, This patch makes GFS2 immediately reclaim/delete all iopen glocks as soon as they're dequeued. This allows deleters to get an EXclusive lock on iopen so files are deleted properly instead of being set as unlinked. Regards, Bob Peterson Red Hat File Systems Signed-off-by: Bob Peterson <rpeterso@redhat.com> --- diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 8833a4f..62b484e 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -189,6 +189,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, return inode; fail_refresh: + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; ip->i_iopen_gh.gh_gl->gl_object = NULL; gfs2_glock_dq_uninit(&ip->i_iopen_gh); fail_iopen: diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 917c8e1..e5639de 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1444,6 +1444,7 @@ static void gfs2_evict_inode(struct inode *inode) /* Must not read inode block until block type has been verified */ error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh); if (unlikely(error)) { + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; gfs2_glock_dq_uninit(&ip->i_iopen_gh); goto out; } @@ -1514,8 +1515,10 @@ out_unlock: if (gfs2_rs_active(ip->i_res)) gfs2_rs_deltree(ip->i_res); - if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) + if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) { + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; gfs2_glock_dq(&ip->i_iopen_gh); + } gfs2_holder_uninit(&ip->i_iopen_gh); gfs2_glock_dq_uninit(&gh); if (error && error != GLR_TRYFAILED && error != -EROFS) @@ -1534,6 +1537,7 @@ out: ip->i_gl = NULL; if (ip->i_iopen_gh.gh_gl) { ip->i_iopen_gh.gh_gl->gl_object = NULL; + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; gfs2_glock_dq_uninit(&ip->i_iopen_gh); } } ^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 PATCH] GFS2: Don't cache iopen glocks 2013-05-29 15:51 ` [Cluster-devel] [GFS2 PATCH] GFS2: Don't cache iopen glocks Bob Peterson @ 2013-06-03 13:41 ` Steven Whitehouse 0 siblings, 0 replies; 2+ messages in thread From: Steven Whitehouse @ 2013-06-03 13:41 UTC (permalink / raw) To: cluster-devel.redhat.com Hi, Now in the -nmw git tree. Thanks, Steve. On Wed, 2013-05-29 at 11:51 -0400, Bob Peterson wrote: > Hi, > > This patch makes GFS2 immediately reclaim/delete all iopen glocks > as soon as they're dequeued. This allows deleters to get an > EXclusive lock on iopen so files are deleted properly instead of > being set as unlinked. > > Regards, > > Bob Peterson > Red Hat File Systems > > Signed-off-by: Bob Peterson <rpeterso@redhat.com> > --- > diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c > index 8833a4f..62b484e 100644 > --- a/fs/gfs2/inode.c > +++ b/fs/gfs2/inode.c > @@ -189,6 +189,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, > return inode; > > fail_refresh: > + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; > ip->i_iopen_gh.gh_gl->gl_object = NULL; > gfs2_glock_dq_uninit(&ip->i_iopen_gh); > fail_iopen: > diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c > index 917c8e1..e5639de 100644 > --- a/fs/gfs2/super.c > +++ b/fs/gfs2/super.c > @@ -1444,6 +1444,7 @@ static void gfs2_evict_inode(struct inode *inode) > /* Must not read inode block until block type has been verified */ > error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh); > if (unlikely(error)) { > + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; > gfs2_glock_dq_uninit(&ip->i_iopen_gh); > goto out; > } > @@ -1514,8 +1515,10 @@ out_unlock: > if (gfs2_rs_active(ip->i_res)) > gfs2_rs_deltree(ip->i_res); > > - if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) > + if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) { > + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; > gfs2_glock_dq(&ip->i_iopen_gh); > + } > gfs2_holder_uninit(&ip->i_iopen_gh); > gfs2_glock_dq_uninit(&gh); > if (error && error != GLR_TRYFAILED && error != -EROFS) > @@ -1534,6 +1537,7 @@ out: > ip->i_gl = NULL; > if (ip->i_iopen_gh.gh_gl) { > ip->i_iopen_gh.gh_gl->gl_object = NULL; > + ip->i_iopen_gh.gh_flags |= GL_NOCACHE; > gfs2_glock_dq_uninit(&ip->i_iopen_gh); > } > } > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-03 13:41 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <348496101.30641165.1369842657387.JavaMail.root@redhat.com> 2013-05-29 15:51 ` [Cluster-devel] [GFS2 PATCH] GFS2: Don't cache iopen glocks Bob Peterson 2013-06-03 13:41 ` Steven Whitehouse
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).