OSDN Git Service

ext4: Fix error code in ext4_xattr_set_entry()
authorDaniel Rosenberg <drosen@google.com>
Mon, 15 Oct 2018 22:10:52 +0000 (15:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:13:20 +0000 (09:13 +0200)
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 <drosen@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c

index c10180d..7d6da09 100644 (file)
@@ -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);