From: Darrick J. Wong Date: Wed, 14 Aug 2019 22:05:17 +0000 (-0400) Subject: xfs: attribute scrub should use seen_enough to pass error values X-Git-Tag: v5.3.0-rc0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07380ef07f8b354609377e2ec2a2ab3fb6496a4f;p=thirdparty%2Fxfsprogs-dev.git xfs: attribute scrub should use seen_enough to pass error values Source kernel commit: 2c3b83d7ca6d73b9478afc86c89377c15a90b9ed When we're iterating all the attributes using the built-in xattr iterator, we can use the seen_enough variable to pass error codes back to the main scrub function instead of flattening them into 0/1. This will be used in a more exciting fashion in upcoming patches. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 3b0dce06e..ff28ebf3b 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -112,7 +112,13 @@ typedef struct xfs_attr_list_context { struct xfs_inode *dp; /* inode */ struct attrlist_cursor_kern *cursor; /* position in list */ char *alist; /* output buffer */ - int seen_enough; /* T/F: seen enough of list? */ + + /* + * Abort attribute list iteration if non-zero. Can be used to pass + * error values to the xfs_attr_list caller. + */ + int seen_enough; + ssize_t count; /* num used entries */ int dupcnt; /* count dup hashvals seen */ int bufsize; /* total buffer size */