Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1440183

[PATCH] f2fs: return proper error code

From "Tiezhu Yang" <kernelpatch@126.com>
Newsgroups linux.kernel
Subject [PATCH] f2fs: return proper error code
Date 2016-07-11 01:30 +0200
Message-ID <rTwkF-7sR-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


When the length of file name is more than F2FS_NAME_LEN,
it should return -ENAMETOOLONG.

Signed-off-by: Tiezhu Yang <kernelpatch@126.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 28a5023..b225062 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -364,7 +364,7 @@ int f2fs_getxattr(struct inode *inode, int index, const char *name,
 
 	len = strlen(name);
 	if (len > F2FS_NAME_LEN)
-		return -ERANGE;
+		return -ENAMETOOLONG;
 
 	base_addr = read_all_xattrs(inode, ipage);
 	if (!base_addr)
@@ -458,7 +458,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;
-- 
1.8.3.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] f2fs: return proper error code "Tiezhu Yang" <kernelpatch@126.com> - 2016-07-11 01:30 +0200
  Re: [f2fs-dev] [PATCH] f2fs: return proper error code Chao Yu <yuchao0@huawei.com> - 2016-07-12 03:50 +0200
    Re:Re: [f2fs-dev] [PATCH] f2fs: return proper error code "Tiezhu Yang" <kernelpatch@126.com> - 2016-07-13 03:10 +0200

csiph-web