Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752081AbbGMJqC (ORCPT ); Mon, 13 Jul 2015 05:46:02 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:52296 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbbGMJqA (ORCPT ); Mon, 13 Jul 2015 05:46:00 -0400 X-AuditID: cbfee61a-f79516d000006302-42-55a388d78d8f From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] f2fs: correct return value of ->setxattr Date: Mon, 13 Jul 2015 17:45:19 +0800 Message-id: <008101d0bd50$b8bc83e0$2a358ba0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdC9UGrlnikno9ztSOKRgeV8+yQlEw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBLMWRmVeSWpSXmKPExsVy+t9jQd3rHYtDDf5v5rB4sn4Ws8WlRe4W l3fNYXNg9ti0qpPNY/eCz0wenzfJBTBHcdmkpOZklqUW6dslcGU0/rrFWLCDs+Lvl4PsDYzz 2LsYOTkkBEwk3p97wwJhi0lcuLeerYuRi0NIYDqjxMNb51ggnFeMEk+vrmIGqWITUJFY3vGf CcQWAbIPLboMNolZwEOiseM7K4gtLGArsf5KC9AkDg4WAVWJ23OrQMK8ApYSi18vYIGwBSV+ TL7HAtGqJbF+53EmCFteYvOat8wQBylI7Dj7mhFilZ7EtgOrmSFqxCU2HrnFMoFRYBaSUbOQ jJqFZNQsJC0LGFlWMYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgSH7zOpHYwrGywOMQpwMCrx 8DZsWRQqxJpYVlyZe4hRgoNZSYQ3p3hxqBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHek/k+oUIC 6YklqdmpqQWpRTBZJg5OqQbG3Iw3WV2NhfteKbPE7NZmSnBXUp2qcys4zy1A6Lj3qe51vU90 HlTq59fNTt/26UFQ356PqjuSt/dX7ZrunfD5kLh58KbZvx4YWJRW/tnqvkO0h62saVfVUvlT d1MXpvxPFJo2XXXrV9ePU0I1FmRekdX99ClXwtS8QfMC1+zbZ+87fOpLN8tQYinOSDTUYi4q TgQAiaTKLlsCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1407 Lines: 51 This patch fixes to return correct error number of ->setxattr, which is reported by xfstest tests/generic/026 as below: generic/026 - output mismatch --- tests/generic/026.out +++ results/generic/026.out.bad @@ -4,6 +4,6 @@ 1 below acl max acl max 1 above acl max -chacl: cannot set access acl on "largeaclfile": Argument list too long +chacl: cannot set access acl on "largeaclfile": Numerical result out of range use 16 aces use 17 aces ... Ran: generic/026 Failures: generic/026 Failed 1 of 1 tests Signed-off-by: Chao Yu --- fs/f2fs/xattr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 07449b98..4de2286 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -499,9 +499,12 @@ static int __f2fs_setxattr(struct inode *inode, int index, len = strlen(name); - if (len > F2FS_NAME_LEN || size > MAX_VALUE_LEN(inode)) + if (len > F2FS_NAME_LEN) return -ERANGE; + if (size > MAX_VALUE_LEN(inode)) + return -E2BIG; + base_addr = read_all_xattrs(inode, ipage); if (!base_addr) goto exit; -- 2.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/