All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make __xfs_xattr_put_listen preperly report errors.
@ 2016-08-23 15:54 ` Artem Savkov
  0 siblings, 0 replies; 19+ messages in thread
From: Artem Savkov @ 2016-08-23 15:54 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Dave Chinner, xfs, linux-kernel, Artem Savkov

Commit "xfs: only return -errno or success from attr ->put_listent" changes the
returnvalue of __xfs_xattr_put_listen to 0 in case when there is insufficient
space in the buffer assuming that setting context->count to -1 would be enough,
but all of the ->put_listent callers only check seen_enough. This results in
a failed assertion:
XFS: Assertion failed: context->count >= 0, file: fs/xfs/xfs_xattr.c, line: 175
in insufficient buffer size case.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
---
 fs/xfs/xfs_xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index ea62245..6290093 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -147,6 +147,7 @@ __xfs_xattr_put_listent(
 	arraytop = context->count + prefix_len + namelen + 1;
 	if (arraytop > context->firstu) {
 		context->count = -1;	/* insufficient space */
+		context->seen_enough = 1;
 		return 0;
 	}
 	offset = (char *)context->alist + context->count;
-- 
2.7.4

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

end of thread, other threads:[~2016-08-29  8:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23 15:54 [PATCH] Make __xfs_xattr_put_listen preperly report errors Artem Savkov
2016-08-23 15:54 ` Artem Savkov
2016-08-24  1:55 ` Dave Chinner
2016-08-24  1:55   ` Dave Chinner
2016-08-24  8:08   ` Artem Savkov
2016-08-24  8:08     ` Artem Savkov
2016-08-25  0:24     ` Dave Chinner
2016-08-25  0:24       ` Dave Chinner
2016-08-25  8:21       ` Artem Savkov
2016-08-25  8:21         ` Artem Savkov
2016-08-25 22:42         ` Dave Chinner
2016-08-25 22:42           ` Dave Chinner
2016-08-26  8:59           ` Artem Savkov
2016-08-26  8:59             ` Artem Savkov
2016-08-28 22:55             ` Dave Chinner
2016-08-28 22:55               ` Dave Chinner
2016-08-29  8:12               ` [PATCH v2] " Artem Savkov
2016-08-29  8:12                 ` Artem Savkov
2016-08-25 21:36 ` [PATCH] " Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.