linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, mszeredi@suse.cz,
	stable@vger.kernel.org
Subject: Re: [PATCH 07/11] gfs2: pass correct dentry to finish_open() in __gfs2_lookup()
Date: Mon, 16 Sep 2013 14:13:14 +0100	[thread overview]
Message-ID: <1379337194.2718.16.camel@menhir> (raw)
In-Reply-To: <1379335925-30858-8-git-send-email-miklos@szeredi.hu>

Hi,

On Mon, 2013-09-16 at 14:52 +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@suse.cz>
> 
> AFAICS if d_splice_alias() returned non-NULL, this code would Oops
> (finish_open expects an instantiated dentry).
> 
> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
> Cc: Steven Whitehouse <swhiteho@redhat.com>
> Cc: stable@vger.kernel.org
> ---
>  fs/gfs2/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
> index 6d7f976..abe7dae 100644
> --- a/fs/gfs2/inode.c
> +++ b/fs/gfs2/inode.c
> @@ -774,7 +774,7 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
>  
>  	d = d_splice_alias(inode, dentry);
>  	if (file && S_ISREG(inode->i_mode))
> -		error = finish_open(file, dentry, gfs2_open_common, opened);
> +		error = finish_open(file, d ? d : dentry, gfs2_open_common, opened);
>  
>  	gfs2_glock_dq_uninit(&gh);
>  	if (error)

Not sure I understand why this is required... when the inode is a
regular file, d can only be an error (if the inode is an error) or it
will be NULL. Since the __gfs2_lookup would terminate further up if the
inode were an error, then d must always be NULL in the regular file
case, so I'm not sure that this is a bug,

Steve.

  reply	other threads:[~2013-09-16 13:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 12:51 [PATCH 00/11] atomic open related fixes Miklos Szeredi
2013-09-16 12:51 ` [PATCH 01/11] vfs: improve i_op->atomic_open() documentation Miklos Szeredi
2013-09-16 12:51 ` [PATCH 02/11] 9p: fix dentry leak in v9fs_vfs_atomic_open_dotl() Miklos Szeredi
2013-09-16 18:19   ` Al Viro
2013-09-16 19:03     ` Miklos Szeredi
2013-09-16 19:50       ` Al Viro
2013-09-16 20:09         ` Miklos Szeredi
2013-09-16 22:02           ` Al Viro
2013-09-16 23:28             ` Al Viro
2013-09-17 10:16               ` Miklos Szeredi
2013-09-17 11:44                 ` Al Viro
2013-09-17 15:36                   ` Miklos Szeredi
2013-09-17 21:23                     ` Al Viro
2013-09-18  8:55                       ` Miklos Szeredi
2013-09-16 12:51 ` [PATCH 03/11] 9p: fix O_EXCL in v9fs_vfs_atomic_open() Miklos Szeredi
2013-09-16 12:51 ` [PATCH 04/11] fuse: fix O_EXCL in fuse_atomic_open() Miklos Szeredi
2013-09-16 12:51 ` [PATCH 05/11] cifs: fix filp leak in cifs_atomic_open() Miklos Szeredi
2013-09-18 15:19   ` Steve French
2013-09-18 15:22     ` Al Viro
2013-09-16 12:52 ` [PATCH 06/11] gfs2: d_splice_alias() cant return error Miklos Szeredi
2013-09-16 13:17   ` Steven Whitehouse
2013-09-16 13:35     ` Miklos Szeredi
2013-09-16 13:56       ` Steven Whitehouse
2013-09-16 12:52 ` [PATCH 07/11] gfs2: pass correct dentry to finish_open() in __gfs2_lookup() Miklos Szeredi
2013-09-16 13:13   ` Steven Whitehouse [this message]
2013-09-16 13:34     ` Miklos Szeredi
2013-09-16 13:54       ` Steven Whitehouse
2013-09-16 12:52 ` [PATCH 08/11] gfs2: fix dentry leaks Miklos Szeredi
2013-09-16 12:52 ` [PATCH 09/11] gfs2: set FILE_CREATED Miklos Szeredi
2013-09-16 13:27   ` Steven Whitehouse
2013-09-16 12:52 ` [PATCH 10/11] nfs: " Miklos Szeredi
2013-09-16 12:52 ` [PATCH 11/11] vfs: don't set FILE_CREATED before calling ->atomic_open() Miklos Szeredi

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=1379337194.2718.16.camel@menhir \
    --to=swhiteho@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@suse.cz \
    --cc=stable@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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 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).