lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 18 May 2009 18:09:23 +0200
From:	Jan Blunck <jblunck@...e.de>
To:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc:	viro@...iv.linux.org.uk, bharata@...ibm.com, dwmw2@...radead.org,
	mszeredi@...e.cz, vaurora@...hat.com
Subject: [PATCH 27/32] union-mount: Always create topmost directory on open

From: Valerie Aurora (Henson) <vaurora@...hat.com>

When we open a directory, unconditionally create a matching directory
on the top-level.  This way we don't have to go back and create all
the directories on the path to an element when we want to copy it up.

Signed-off-by: Jan Blunck <jblunck@...e.de>
Signed-off-by: Valerie Aurora (Henson) <vaurora@...hat.com>
---
 fs/namei.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 4d68597..684619c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1265,8 +1265,9 @@ static int __link_path_walk(const char *name, struct nameidata *nd)
 		if (err)
 			break;
 
-		if ((nd->flags & LOOKUP_TOPMOST) &&
-		    (nd->um_flags & LAST_LOWLEVEL)) {
+		if ((nd->um_flags & LAST_LOWLEVEL) &&
+		    (S_ISDIR(next.dentry->d_inode->i_mode) ||
+		     (nd->flags & LOOKUP_TOPMOST))) {
 			struct dentry *dentry;
 
 			dentry = union_create_topmost(nd, &this, &next);
@@ -1330,8 +1331,9 @@ last_component:
 		if (err)
 			break;
 
-		if ((nd->flags & LOOKUP_TOPMOST) &&
-		    (nd->um_flags & LAST_LOWLEVEL)) {
+		if ((nd->um_flags & LAST_LOWLEVEL) &&
+		    (S_ISDIR(next.dentry->d_inode->i_mode) ||
+		     (nd->flags & LOOKUP_TOPMOST))) {
 			struct dentry *dentry;
 
 			dentry = union_create_topmost(nd, &this, &next);
-- 
1.6.1.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

Powered by Openwall GNU/*/Linux Powered by OpenVZ