Commit 1da4bd9f authored by David Howells's avatar David Howells
Browse files

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: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
Tested-by: default avatarJonathan Billings <jsbillings@jsbillings.org>
parent 158d5833
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -136,6 +136,9 @@ static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentr


	ASSERTCMP(d_inode(dentry), ==, NULL);
	ASSERTCMP(d_inode(dentry), ==, NULL);


	if (flags & LOOKUP_CREATE)
		return ERR_PTR(-EOPNOTSUPP);

	if (dentry->d_name.len >= AFSNAMEMAX) {
	if (dentry->d_name.len >= AFSNAMEMAX) {
		_leave(" = -ENAMETOOLONG");
		_leave(" = -ENAMETOOLONG");
		return ERR_PTR(-ENAMETOOLONG);
		return ERR_PTR(-ENAMETOOLONG);