History

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.

David Sterba committed 15 years ago

Commit 48150531 parent a39f7521 file · +9 −0Browse files

Unified · Split

fs/btrfs/xattr.c+9−0
@@ -116,6 +116,12 @@ static int do_setxattr(struct btrfs_trans_handle *trans, · 115 unmodified lines
116116 if (ret)
117117 goto out;
118118 btrfs_release_path(path);
119+
120+ /*
121+ * remove the attribute
122+ */
123+ if (!value)
124+ goto out;
119125 }
120126
121127 again:
@@ -158,6 +164,9 @@ out: · 36 unmodified lines
158164 return ret;
159165 }
160166
167+/*
168+ * @value: "" makes the attribute to empty, NULL removes it
169+ */
161170 int __btrfs_setxattr(struct btrfs_trans_handle *trans,
162171 struct inode *inode, const char *name,
163172 const void *value, size_t size, int flags)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t