An attribute is not removed by 'setfattr -x attr file' and remains visible in attr list. This makes xfstests/062 pass again.
Unified · Split
| @@ -116,6 +116,12 @@ static int do_setxattr(struct btrfs_trans_handle *trans, · 115 unmodified lines | |||
| 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 | ||
| 121 | again: | 127 | again: |
| @@ -158,6 +164,9 @@ out: · 36 unmodified lines | |||
| 158 | return ret; | 164 | return ret; |
| 159 | } | 165 | } |
| 160 | 166 | ||
| 167 | /* | ||
| 168 | * @value: "" makes the attribute to empty, NULL removes it | ||
| 169 | */ | ||
| 161 | int __btrfs_setxattr(struct btrfs_trans_handle *trans, | 170 | int __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) |