Ack: [PATCH 1/1] UBUNTU: ubuntu: overlayfs -- fix missmerge of vfs_open changes

Leann Ogasawara leann.ogasawara at canonical.com
Fri Mar 8 14:49:31 UTC 2013


On 03/08/2013 06:12 AM, Andy Whitcroft wrote:
> Quantal is based on v3.5 which sits at an unfortuanate juncture in the
> evolution of the open code.  At this specific time there is an open coded
> side effect (see below) on the success path for the calls do_dentry_open().
> When injecting the vfs_open (again open coded) into the nameidata_to_filp()
> routine to avoid the success path reference counting issues, this side
> effect was lost.  Re-add this to avoid panics:
>
>     nd->intent.open.file = NULL;
>
> BugLink: http://bugs.launchpad.net/bugs/1122094
> BugLink: http://bugs.launchpad.net/bugs/1147678
> Signed-off-by: Andy Whitcroft <apw at canonical.com>

Acked-by: Leann Ogasawara <leann.ogasawara at canonical.com>

> ---
>  fs/open.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/open.c b/fs/open.c
> index a500c82..97b46a3 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -833,8 +833,13 @@ struct file *nameidata_to_filp(struct nameidata *nd)
>  		struct file *res;
>  		struct inode *inode = nd->path.dentry->d_inode;
>  
> -		if (inode->i_op->open)
> -			return inode->i_op->open(nd->path.dentry, filp, cred);
> +		if (inode->i_op->open) {
> +			res = inode->i_op->open(nd->path.dentry, filp, cred);
> +			if (!IS_ERR(res)) {
> +				nd->intent.open.file = NULL;
> +			}
> +			return res;
> +		}
>  
>  		res = do_dentry_open(&nd->path, filp, NULL, cred);
>  		if (!IS_ERR(res)) {





More information about the kernel-team mailing list