All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tiezhu Yang" <kernelpatch@126.com>
To: jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs: return proper error code
Date: Mon, 11 Jul 2016 07:20:36 +0800 (CST)	[thread overview]
Message-ID: <74f6ce4.4fb.155d71ccc53.Coremail.kernelpatch@126.com> (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
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape

WARNING: multiple messages have this Message-ID (diff)
From: "Tiezhu Yang" <kernelpatch@126.com>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] f2fs: return proper error code
Date: Mon, 11 Jul 2016 07:20:36 +0800 (CST)	[thread overview]
Message-ID: <74f6ce4.4fb.155d71ccc53.Coremail.kernelpatch@126.com> (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

             reply	other threads:[~2016-07-10 23:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-10 23:20 Tiezhu Yang [this message]
2016-07-10 23:20 ` [PATCH] f2fs: return proper error code Tiezhu Yang
2016-07-12  1:45 ` Chao Yu
2016-07-12  1:45   ` [f2fs-dev] " Chao Yu
2016-07-13  0:27   ` Tiezhu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74f6ce4.4fb.155d71ccc53.Coremail.kernelpatch@126.com \
    --to=kernelpatch@126.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.