Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Sterba and committed by
Chris Mason
4815053a a39f7521

+9
+9
fs/btrfs/xattr.c
··· 116 116 if (ret) 117 117 goto out; 118 118 btrfs_release_path(path); 119 + 120 + /* 121 + * remove the attribute 122 + */ 123 + if (!value) 124 + goto out; 119 125 } 120 126 121 127 again: ··· 164 158 return ret; 165 159 } 166 160 161 + /* 162 + * @value: "" makes the attribute to empty, NULL removes it 163 + */ 167 164 int __btrfs_setxattr(struct btrfs_trans_handle *trans, 168 165 struct inode *inode, const char *name, 169 166 const void *value, size_t size, int flags)