Commit 01e6deb2 authored by Liu Bo's avatar Liu Bo Committed by Chris Mason

Btrfs: don't add a NULL extended attribute

Passing a null extended attribute value means to remove the attribute,
but we don't have to add a new NULL extended attribute.
Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 755ac67f
...@@ -122,6 +122,16 @@ static int do_setxattr(struct btrfs_trans_handle *trans, ...@@ -122,6 +122,16 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
*/ */
if (!value) if (!value)
goto out; goto out;
} else {
di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode),
name, name_len, 0);
if (IS_ERR(di)) {
ret = PTR_ERR(di);
goto out;
}
if (!di && !value)
goto out;
btrfs_release_path(path);
} }
again: again:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment