public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix wrong value returned from btrfs_listxattr when buffer is too small
@ 2008-12-12 22:36 Yehuda Sadeh Weinraub
  2008-12-17 15:22 ` Chris Mason
  2008-12-19  0:25 ` Sage Weil
  0 siblings, 2 replies; 4+ messages in thread
From: Yehuda Sadeh Weinraub @ 2008-12-12 22:36 UTC (permalink / raw)
  To: linux-btrfs

Fix bug, btrfs_listxattr doesn't return an error when the buffer size
is too small (ret was overridden).

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
---
 fs/btrfs/xattr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index adb4b32..4146f07 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -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);
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-19  1:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-12 22:36 [PATCH] fix wrong value returned from btrfs_listxattr when buffer is too small Yehuda Sadeh Weinraub
2008-12-17 15:22 ` Chris Mason
2008-12-19  0:25 ` Sage Weil
2008-12-19  1:42   ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox