Return-Path: Received: from mail-pl1-f172.google.com ([209.85.214.172]:39409 "EHLO mail-pl1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbeJPF6p (ORCPT ); Tue, 16 Oct 2018 01:58:45 -0400 Received: by mail-pl1-f172.google.com with SMTP id e67-v6so969760plb.6 for ; Mon, 15 Oct 2018 15:11:36 -0700 (PDT) From: Daniel Rosenberg To: stable@vger.kernel.org Cc: Ben Hutchings , Daniel Rosenberg Subject: [PATCH] ext4: Fix error code in ext4_xattr_set_entry() Date: Mon, 15 Oct 2018 15:10:52 -0700 Message-Id: <20181015221052.104133-1-drosen@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: ext4_xattr_set_entry should return EFSCORRUPTED instead of EIO for corrupted xattr entries. Fixes b469713e0c0c ("ext4: add corruption check in ext4_xattr_set_entry()") Signed-off-by: Daniel Rosenberg --- Apply to 4.9 fs/ext4/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index c10180d0b0189..7d6da09e637b7 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -657,7 +657,7 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s, next = EXT4_XATTR_NEXT(last); if ((void *)next >= s->end) { EXT4_ERROR_INODE(inode, "corrupted xattr entries"); - return -EIO; + return -EFSCORRUPTED; } if (last->e_value_size) { size_t offs = le16_to_cpu(last->e_value_offs); -- 2.19.1.331.ge82ca0e54c-goog