提交 4815053a 编写于 作者: D David Sterba 提交者: Chris Mason

btrfs: xattr: fix attribute removal

An attribute is not removed by 'setfattr -x attr file' and remains
visible in attr list. This makes xfstests/062 pass again.
Signed-off-by: NDavid Sterba <dsterba@suse.cz>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 a39f7521
...@@ -116,6 +116,12 @@ static int do_setxattr(struct btrfs_trans_handle *trans, ...@@ -116,6 +116,12 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
if (ret) if (ret)
goto out; goto out;
btrfs_release_path(path); btrfs_release_path(path);
/*
* remove the attribute
*/
if (!value)
goto out;
} }
again: again:
...@@ -158,6 +164,9 @@ static int do_setxattr(struct btrfs_trans_handle *trans, ...@@ -158,6 +164,9 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
/*
* @value: "" makes the attribute to empty, NULL removes it
*/
int __btrfs_setxattr(struct btrfs_trans_handle *trans, int __btrfs_setxattr(struct btrfs_trans_handle *trans,
struct inode *inode, const char *name, struct inode *inode, const char *name,
const void *value, size_t size, int flags) const void *value, size_t size, int flags)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册