aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2011-09-11 10:52:25 -0400
committerChris Mason <chris.mason@oracle.com>2011-09-11 10:52:25 -0400
commit4815053aba7f2304055745df820cd74a39fdaab2 (patch)
tree30a936c6ebe75af2e8f9c92f7922989ad7b2e111 /fs
parenta39f75214358d715efa21e2bccf5a709d8649144 (diff)
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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index d733b9cfea3..69565e5fc6a 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -116,6 +116,12 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
116 if (ret) 116 if (ret)
117 goto out; 117 goto out;
118 btrfs_release_path(path); 118 btrfs_release_path(path);
119
120 /*
121 * remove the attribute
122 */
123 if (!value)
124 goto out;
119 } 125 }
120 126
121again: 127again:
@@ -158,6 +164,9 @@ out:
158 return ret; 164 return ret;
159} 165}
160 166
167/*
168 * @value: "" makes the attribute to empty, NULL removes it
169 */
161int __btrfs_setxattr(struct btrfs_trans_handle *trans, 170int __btrfs_setxattr(struct btrfs_trans_handle *trans,
162 struct inode *inode, const char *name, 171 struct inode *inode, const char *name,
163 const void *value, size_t size, int flags) 172 const void *value, size_t size, int flags)