All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: replace ERANGE with ENAMETOOLONG in file name length check
@ 2021-06-15  1:35 Wang Xiaojun
  2021-06-15  2:31 ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Wang Xiaojun @ 2021-06-15  1:35 UTC (permalink / raw)
  To: yuchao0, jaegeuk; +Cc: linux-f2fs-devel

ERANGE indicates that the math result is not representative. Here,
ENAMETOOLONG is used to replace ERANGE.

Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
---
 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
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-16 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15  1:35 [f2fs-dev] [PATCH] f2fs: replace ERANGE with ENAMETOOLONG in file name length check Wang Xiaojun
2021-06-15  2:31 ` Gao Xiang
2021-06-15  3:19   ` wangxiaojun (N)
2021-06-15  3:44     ` Gao Xiang
2021-06-16 13:21   ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.