OSDN Git Service

btrfs: do proper error handling in btrfs_insert_xattr_item
authorDavid Sterba <dsterba@suse.com>
Fri, 17 Feb 2017 18:42:43 +0000 (19:42 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 28 Feb 2017 13:27:11 +0000 (14:27 +0100)
commitb9d04c607c21fafe0a346792d0d358e7ab9a768e
tree1f6ab876f9759503b17c6e1fa97af8c38938251e
parentfa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a
btrfs: do proper error handling in btrfs_insert_xattr_item

The space check in btrfs_insert_xattr_item is duplicated in it's caller
(do_setxattr) so we won't hit the BUG_ON. Continuing without any check
could be disasterous so turn it to a proper error handling.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dir-item.c