Btrfs: fix return value from btrfs_listxattr when buffer size is too small
authorYehuda Sadeh Weinraub <yehudasa@gmail.com>
Wed, 17 Dec 2008 15:21:26 +0000 (10:21 -0500)
committerChris Mason <chris.mason@oracle.com>
Wed, 17 Dec 2008 15:21:26 +0000 (10:21 -0500)
The return value was being overwritten.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
fs/btrfs/xattr.c

index adb4b32a9d5115bd8987e00a64a34f6b93d42ca8..4146f0710e6acbde7f1d5cf9e9b90ecf7316a67d 100644 (file)
@@ -226,7 +226,7 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size)
 
                if (!buffer || (name_len + 1) > size_left) {
                        ret = -ERANGE;
-                       break;
+                       goto err;
                }
 
                name_ptr = (unsigned long)(di + 1);