From 249369d85d5b89277608db57d11a8ec9ad14ef4e Mon Sep 17 00:00:00 2001 From: David Sterba Date: Sun, 11 Sep 2011 10:52:25 -0400 Subject: [PATCH] --- yaml --- r: 263738 b: refs/heads/master c: 4815053aba7f2304055745df820cd74a39fdaab2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/xattr.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c3012263b4ec..c83cde97c4d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a39f75214358d715efa21e2bccf5a709d8649144 +refs/heads/master: 4815053aba7f2304055745df820cd74a39fdaab2 diff --git a/trunk/fs/btrfs/xattr.c b/trunk/fs/btrfs/xattr.c index d733b9cfea34..69565e5fc6a0 100644 --- a/trunk/fs/btrfs/xattr.c +++ b/trunk/fs/btrfs/xattr.c @@ -116,6 +116,12 @@ static int do_setxattr(struct btrfs_trans_handle *trans, if (ret) goto out; btrfs_release_path(path); + + /* + * remove the attribute + */ + if (!value) + goto out; } again: @@ -158,6 +164,9 @@ static int do_setxattr(struct btrfs_trans_handle *trans, return ret; } +/* + * @value: "" makes the attribute to empty, NULL removes it + */ int __btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode, const char *name, const void *value, size_t size, int flags)