Skip to content

Commit

Permalink
afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dhowells committed Dec 11, 2019
1 parent 158d583 commit 1da4bd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/afs/dynroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1da4bd9

Please sign in to comment.