summaryrefslogtreecommitdiffstats
path: root/fs/afs/dynroot.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-12-11 08:56:04 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-09 10:18:57 +0100
commit281c1b305274851ae9304345a0f47c2670eb73d2 (patch)
treed2623a109659598e874954413d04dd7a32b770c7 /fs/afs/dynroot.c
parentb280f0ea1c8332a1dc10542064d2f2e934ccf7e0 (diff)
downloadlinux-stable-281c1b305274851ae9304345a0f47c2670eb73d2.tar.gz
linux-stable-281c1b305274851ae9304345a0f47c2670eb73d2.tar.bz2
linux-stable-281c1b305274851ae9304345a0f47c2670eb73d2.zip
afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP
[ Upstream commit 1da4bd9f9d187f53618890d7b66b9628bbec3c70 ] Fix the lookup method on the dynamic root directory such that creation calls, such as mkdir, open(O_CREAT), symlink, etc. fail with EOPNOTSUPP rather than failing with some odd error (such as EEXIST). lookup() itself tries to create automount directories when it is invoked. These are cached locally in RAM and not committed to storage. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Marc Dionne <marc.dionne@auristor.com> Tested-by: Jonathan Billings <jsbillings@jsbillings.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/afs/dynroot.c')
-rw-r--r--fs/afs/dynroot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c
index f29c6dade7f6..069273a2483f 100644
--- a/fs/afs/dynroot.c
+++ b/fs/afs/dynroot.c
@@ -145,6 +145,9 @@ static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentr
ASSERTCMP(d_inode(dentry), ==, NULL);
+ if (flags & LOOKUP_CREATE)
+ return ERR_PTR(-EOPNOTSUPP);
+
if (dentry->d_name.len >= AFSNAMEMAX) {
_leave(" = -ENAMETOOLONG");
return ERR_PTR(-ENAMETOOLONG);