diff options
author | David Sterba <dsterba@suse.cz> | 2011-09-11 16:52:25 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-09-11 16:52:25 +0200 |
commit | 4815053aba7f2304055745df820cd74a39fdaab2 (patch) | |
tree | 30a936c6ebe75af2e8f9c92f7922989ad7b2e111 /fs | |
parent | Btrfs: fix wrong nbytes information of the inode (diff) | |
download | linux-4815053aba7f2304055745df820cd74a39fdaab2.tar.xz linux-4815053aba7f2304055745df820cd74a39fdaab2.zip |
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 <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/xattr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index d733b9cfea34..69565e5fc6a0 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) |