On 2021/6/15 10:31, Gao Xiang wrote:
On Tue, Jun 15, 2021 at 09:35:09AM +0800, Wang Xiaojun wrote:
ERANGE indicates that the math result is not representative. Here,
ENAMETOOLONG is used to replace ERANGE.

Signed-off-by: Wang Xiaojun <[email protected]>

I don't think ENAMETOOLONG is a valid return code for {g,s}etxattr.
https://man7.org/linux/man-pages/man2/getxattr.2.html
https://man7.org/linux/man-pages/man2/setxattr.2.html
instead of ERANGE.

Agreed, it should implement according to man of {g,s}etxattr.

Thanks,


please also see ext4 / xfs implementations.

Thanks,
Gao Xiang


---
  fs/f2fs/xattr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index c8f34decbf8e..eb827c10e970 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -529,7 +529,7 @@ int f2fs_getxattr(struct inode *inode, int index, const 
char *name,
len = strlen(name);
        if (len > F2FS_NAME_LEN)
-               return -ERANGE;
+               return -ENAMETOOLONG;
down_read(&F2FS_I(inode)->i_xattr_sem);
        error = lookup_all_xattrs(inode, ipage, index, len, name,
@@ -646,7 +646,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
        len = strlen(name);
if (len > F2FS_NAME_LEN)
-               return -ERANGE;
+               return -ENAMETOOLONG;
if (size > MAX_VALUE_LEN(inode))
                return -E2BIG;
--
2.25.4



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to