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:	Tue,  5 May 2015 06:22:32 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Neil Brown <neilb@...e.de>, Christoph Hellwig <hch@...radead.org>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: [PATCH 58/79] trailing_symlink: nd->depth massage, part 7

From: Al Viro <viro@...iv.linux.org.uk>

move decrement of nd->depth on successful returns into the callers.

Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
 fs/namei.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index f81a029..b7b1c2b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2001,10 +2001,8 @@ static int trailing_symlink(struct nameidata *nd)
 	s = get_link(nd);
 	if (unlikely(IS_ERR(s)))
 		return PTR_ERR(s);
-	if (unlikely(!s)) {
-		nd->depth--;
+	if (unlikely(!s))
 		return 0;
-	}
 	if (*s == '/') {
 		if (!nd->root.mnt)
 			set_root(nd);
@@ -2020,7 +2018,6 @@ static int trailing_symlink(struct nameidata *nd)
 		put_link(nd);
 		return error;
 	}
-	nd->depth--;
 	return 0;
 }
 
@@ -2061,6 +2058,7 @@ static int path_lookupat(int dfd, const struct filename *name,
 			if (err)
 				break;
 			err = lookup_last(nd);
+			nd->depth--;
 			put_link(nd);
 		}
 	}
@@ -2410,6 +2408,7 @@ path_mountpoint(int dfd, const struct filename *name, struct path *path,
 		if (err)
 			break;
 		err = mountpoint_last(nd, path);
+		nd->depth--;
 		put_link(nd);
 	}
 out:
@@ -3296,6 +3295,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
 		if (unlikely(error))
 			break;
 		error = do_last(nd, file, op, &opened, pathname);
+		nd->depth--;
 		put_link(nd);
 	}
 out:
-- 
2.1.4

--
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