From: David Sterba Date: Sun, 11 Sep 2011 14:52:25 +0000 (-0400) Subject: btrfs: xattr: fix attribute removal X-Git-Tag: v3.12-rc1~4691^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4815053aba7f2304055745df820cd74a39fdaab2;p=kernel%2Fkernel-generic.git 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: David Sterba Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index d733b9c..69565e5 100644 --- a/fs/btrfs/xattr.c +++ b/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 @@ out: 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)