From: Liu Bo Date: Mon, 26 Nov 2012 02:58:36 +0000 (+0000) Subject: Btrfs: fix an while-loop of listxattr X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=db2254bce4f19f458aaa05f9d00b39f413f7488c;p=deliverable%2Flinux.git Btrfs: fix an while-loop of listxattr If we found an invalid xattr dir item, we'd better try the next one instead. Signed-off-by: Liu Bo Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 3f4e2d69e83a..e9d384055494 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -265,7 +265,7 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item); if (verify_dir_item(root, leaf, di)) - continue; + goto next; name_len = btrfs_dir_name_len(leaf, di); total_size += name_len + 1;