Skip to content

Commit

Permalink
btrfs: xattr: fix attribute removal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Sterba authored and Chris Mason committed Sep 11, 2011
1 parent a39f752 commit 4815053
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/btrfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -158,6 +164,9 @@ static int do_setxattr(struct btrfs_trans_handle *trans,
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)
Expand Down

0 comments on commit 4815053

Please sign in to comment.