]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
xfs: only return -errno or success from attr ->put_listent
authorEric Sandeen <sandeen@sandeen.net>
Tue, 5 Apr 2016 21:57:18 +0000 (07:57 +1000)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 27 Jun 2017 13:16:20 +0000 (10:16 -0300)
commit4efd315ffd21af4de7bb6a048fe9dc0d06921801
tree6528b0b843e6bea93d81a9720a488d033f2c81db
parent89e3d05badfe1c0c1ad783edf58c3270cc5f8b5d
xfs: only return -errno or success from attr ->put_listent

BugLink: http://bugs.launchpad.net/bugs/1697001
commit 2a6fba6d2311151598abaa1e7c9abd5f8d024a43 upstream.

Today, the put_listent formatters return either 1 or 0; if
they return 1, some callers treat this as an error and return
it up the stack, despite "1" not being a valid (negative)
error code.

The intent seems to be that if the input buffer is full,
we set seen_enough or set count = -1, and return 1;
but some callers check the return before checking the
seen_enough or count fields of the context.

Fix this by only returning non-zero for actual errors
encountered, and rely on the caller to first check the
return value, then check the values in the context to
decide what to do.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/xfs/xfs_attr.h
fs/xfs/xfs_attr_list.c
fs/xfs/xfs_xattr.c