aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-12-11 08:56:04 +0000
committerDavid Howells <dhowells@redhat.com>2019-12-11 17:47:51 +0000
commit1da4bd9f9d187f53618890d7b66b9628bbec3c70 (patch)
treee1729fcc98277bf76544ae497a05710523ee29f2 /fs
parentafs: Fix mountpoint parsing (diff)
downloadlinux-dev-1da4bd9f9d187f53618890d7b66b9628bbec3c70.tar.xz
linux-dev-1da4bd9f9d187f53618890d7b66b9628bbec3c70.zip
afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP
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>
Diffstat (limited to 'fs')
-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 4150280509ff..7503899c0a1b 100644
--- a/fs/afs/dynroot.c
+++ b/fs/afs/dynroot.c
@@ -136,6 +136,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);