[PATCH]: Return better error code from vfs_unlink if operation is not defined.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

If the unlink function is not defined by filesystem, then I think it
is better to return operation not supported rather than saying
permission denied, which can come from lot other places and keep user
guessing what went wrong. I came across this while testing one of my
small modules.


Signed-off-by: Manish Katiyar <mkatiyar@xxxxxxxxx>
---
 fs/namei.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index bbc15c2..02c8d7f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2208,7 +2208,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
 		return error;

 	if (!dir->i_op->unlink)
-		return -EPERM;
+		return -EOPNOTSUPP;

 	DQUOT_INIT(dir);

-- 
1.5.4.3

Thanks -
Manish
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux