[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1284675145-4391-29-git-send-email-vaurora@redhat.com>
Date: Thu, 16 Sep 2010 15:12:19 -0700
From: Valerie Aurora <vaurora@...hat.com>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Miklos Szeredi <miklos@...redi.hu>,
Christoph Hellwig <hch@...radead.org>,
Andreas Gruenbacher <agruen@...e.de>,
Nick Piggin <npiggin@...nel.dk>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Valerie Aurora <vaurora@...hat.com>
Subject: [PATCH 28/34] union-mount: Process negative dentries in __union_lookup()
Whiteouts end a union lookup. So do opaque directories, unless
specific fallthru entry exists for this name.
Signed-off-by: Valerie Aurora <vaurora@...hat.com>
---
fs/namei.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 8373463..f6ad8b3 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -781,11 +781,32 @@ static int __lookup_union(struct nameidata *nd, struct qstr *name,
err = PTR_ERR(lower.dentry);
goto out_err;
}
- /* XXX - do nothing, lookup rule processing in later patches */
+
+ /*
+ * A negative dentry can mean several things. A plain
+ * negative dentry is ignored and lookup continues to
+ * the next layer. But a whiteout or a non-fallthru
+ * in an opaque dir covers everything below it.
+ */
+ if (!lower.dentry->d_inode) {
+ if (d_is_whiteout(lower.dentry))
+ goto out_lookup_done;
+ if (IS_OPAQUE(nd->path.dentry->d_inode) &&
+ !d_is_fallthru(lower.dentry))
+ goto out_lookup_done;
+ path_put(&lower);
+ continue;
+ }
+
+ /* XXX - do nothing, more in later patches */
path_put(&lower);
}
return 0;
+out_lookup_done:
+ path_put(&lower);
+ return 0;
+
out_err:
d_free_unions(topmost->dentry);
path_put(&lower);
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists