lkml.org 
[lkml]   [2009]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 25/41] union-mount: stop lookup when directory has S_OPAQUE flag set
In message <1256152779-10054-26-git-send-email-vaurora@redhat.com>, Valerie Aurora writes:
> From: Jan Blunck <jblunck@suse.de>
>
> Honor the S_OPAQUE flag in the union path lookup.

Was it intentional to have a separate patch which adds opaque directories
support, or should it be part of the larger patch #24?

>
> Signed-off-by: Jan Blunck <jblunck@suse.de>
> Signed-off-by: Valerie Aurora <vaurora@redhat.com>
> ---
> fs/namei.c | 17 ++++++++++++++---
> 1 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index b279686..8ebbf4f 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -523,6 +523,9 @@ static int __cache_lookup_build_union(struct nameidata *nd, struct qstr *name,
> path_put(&last);
> last.dentry = dentry;
> last.mnt = mntget(nd->path.mnt);
> +
> + if (IS_OPAQUE(last.dentry->d_inode))
> + break;
> }
>
> if (last.dentry != path->dentry)
> @@ -562,7 +565,8 @@ static int cache_lookup_union(struct nameidata *nd, struct qstr *name,
>
> /* only directories can be part of a union stack */
> if (!path->dentry->d_inode ||
> - !S_ISDIR(path->dentry->d_inode->i_mode))
> + !S_ISDIR(path->dentry->d_inode->i_mode) ||
> + IS_OPAQUE(path->dentry->d_inode))
> goto out;
>
> /* Build the union stack for this part */
> @@ -804,6 +808,9 @@ static int __real_lookup_build_union(struct nameidata *nd, struct qstr *name,
> path_put(&last);
> last.dentry = next.dentry;
> last.mnt = mntget(next.mnt);
> +
> + if (IS_OPAQUE(last.dentry->d_inode))
> + break;
> }
>
> if (last.dentry != path->dentry)
> @@ -825,7 +832,8 @@ static int real_lookup_union(struct nameidata *nd, struct qstr *name,
>
> /* only directories can be part of a union stack */
> if (!path->dentry->d_inode ||
> - !S_ISDIR(path->dentry->d_inode->i_mode))
> + !S_ISDIR(path->dentry->d_inode->i_mode) ||
> + IS_OPAQUE(path->dentry->d_inode))
> goto out;
>
> /* Build the union stack for this part */
> @@ -1111,7 +1119,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
> {
> int err;
>
> - if (IS_MNT_UNION(nd->path.mnt))
> + if (IS_MNT_UNION(nd->path.mnt) && !IS_OPAQUE(nd->path.dentry->d_inode))
> goto need_union_lookup;
>
> path->dentry = __d_lookup(nd->path.dentry, name);
> @@ -1676,6 +1684,9 @@ static int __hash_lookup_build_union(struct nameidata *nd, struct qstr *name,
> path_put(&last);
> last.dentry = next.dentry;
> last.mnt = mntget(next.mnt);
> +
> + if (IS_OPAQUE(last.dentry->d_inode))
> + break;
> }
>
> if (last.dentry != path->dentry)
> --
> 1.6.3.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

Erez.


\
 
 \ /
  Last update: 2009-12-01 05:13    [W:1.751 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site