From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Check if iopen is held when deleting inode
Date: Tue, 2 Feb 2016 11:56:23 +0000 [thread overview]
Message-ID: <56B09967.4040409@redhat.com> (raw)
In-Reply-To: <261186611.36036826.1450463926249.JavaMail.zimbra@redhat.com>
Hi,
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Steve.
On 18/12/15 18:38, Bob Peterson wrote:
> Hi,
>
> This patch fixes an error condition in which an inode is partially
> created in gfs2_create_inode() but then some error is discovered,
> which causes it to fail and call iput() before the iopen glock is
> created or held. In that case, gfs2_delete_inode would try to
> unlock an iopen glock that doesn't yet exist. Therefore, we test
> its holder (which must exist) for the HIF_HOLDER bit before trying
> to dq it.
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
>
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 8f960a5..d354e72 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -1551,12 +1551,15 @@ static void gfs2_evict_inode(struct inode *inode)
> goto out_truncate;
> }
>
> - ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
> - gfs2_glock_dq_wait(&ip->i_iopen_gh);
> - gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh);
> - error = gfs2_glock_nq(&ip->i_iopen_gh);
> - if (error)
> - goto out_truncate;
> + if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) {
> + ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
> + gfs2_glock_dq_wait(&ip->i_iopen_gh);
> + gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE,
> + &ip->i_iopen_gh);
> + error = gfs2_glock_nq(&ip->i_iopen_gh);
> + if (error)
> + goto out_truncate;
> + }
>
> /* Case 1 starts here */
>
>
prev parent reply other threads:[~2016-02-02 11:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <747868619.36036602.1450463887728.JavaMail.zimbra@redhat.com>
2015-12-18 18:38 ` [Cluster-devel] [GFS2 PATCH] GFS2: Check if iopen is held when deleting inode Bob Peterson
2016-01-12 15:25 ` [Cluster-devel] [GFS2 PATCH v2] " Bob Peterson
2016-01-12 15:27 ` Steven Whitehouse
2016-02-02 11:56 ` Steven Whitehouse [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56B09967.4040409@redhat.com \
--to=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.