Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1500523
| From | Vineeth Remanan Pillai <vineethp@amazon.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag |
| Date | 2016-10-13 22:00 +0200 |
| Message-ID | <srUkx-7Wj-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
filename_lookup used to return success for non-existing file when called
with LOOKUP_PARENT flag. This behaviour was changed with
commit 8bcb77fabd7c ("namei: split off filename_lookupat()
with LOOKUP_PARENT")
The above patch split parent lookup functionality to a different function
filename_parentat and changed all calls to filename_lookup(LOOKUP_PARENT)
to the new function filename_parentat. But functions like kern_path which
passed the flags directly to filename_lookup regressed due to this.
This patch aims to fix the regressed behaviour by calling
filename_parentat from filename_lookup if the flags contain LOOKUP_PARENT.
Signed-off-by: Vineeth Remanan Pillai <vineethp@amazon.com>
---
fs/namei.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/fs/namei.c b/fs/namei.c
index adb0414..e16ab09 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2292,6 +2292,21 @@ static int filename_lookup(int dfd, struct filename *name, unsigned flags,
{
int retval;
struct nameidata nd;
+
+ if (flags & LOOKUP_PARENT) {
+ struct qstr last;
+ struct filename *filename;
+ int type;
+
+ filename = filename_parentat(dfd, name, flags ^ LOOKUP_PARENT,
+ path, &last, &type);
+ if (IS_ERR(filename))
+ return PTR_ERR(filename);
+
+ putname(filename);
+ return 0;
+ }
+
if (IS_ERR(name))
return PTR_ERR(name);
if (unlikely(root)) {
--
2.1.2.AMZN
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Vineeth Remanan Pillai <vineethp@amazon.com> - 2016-10-13 22:00 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Al Viro <viro@ZenIV.linux.org.uk> - 2016-10-13 22:10 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Christoph Hellwig <hch@infradead.org> - 2016-10-13 22:20 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Christoph Hellwig <hch@infradead.org> - 2016-10-13 22:50 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Al Viro <viro@ZenIV.linux.org.uk> - 2016-10-13 22:50 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Vineeth Remanan Pillai <vineethp@amazon.com> - 2016-10-13 22:50 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Al Viro <viro@ZenIV.linux.org.uk> - 2016-10-13 23:30 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Vineeth Remanan Pillai <vineethp@amazon.com> - 2016-10-14 00:20 +0200
Re: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag Al Viro <viro@ZenIV.linux.org.uk> - 2016-10-14 01:40 +0200
RE: [PATCH] namei: revert old behaviour for filename_lookup with LOOKUP_PARENT flag "Remanan Pillai, Vineeth" <vineethp@amazon.com> - 2016-10-14 02:10 +0200
csiph-web