From 1cab7fafd016621160f49030ea46f155fe34d70b Mon Sep 17 00:00:00 2001 From: James Simmons Date: Fri, 24 Jan 2020 11:45:48 -0500 Subject: [PATCH] LU-12598 osd-ldiskfs: always return errors for osd_ios_lf_fill While working on ARM ldiskfs support it was noticed that osd_ios_lf_fill() behaves differently then the other olm_filldir handlers. On failure of osd_lookup_one_len() osd_ios_lf_fill() silently returns zero when it should return an error code. Change to return proper error codes and update the cdebug messages. Change-Id: I528b18aaa7277133875cba5db3150ce34cc6431a Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/37323 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Yang Sheng Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/osd-ldiskfs/osd_scrub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index 63c295b..628771a 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -2016,14 +2016,15 @@ static int osd_ios_lf_fill(void *buf, scrub->os_lf_scanned++; child = osd_lookup_one_len(dev, name, parent, namelen); if (IS_ERR(child)) { + rc = PTR_ERR(child); CDEBUG(D_LFSCK, "%s: cannot lookup child '%.*s': rc = %d\n", - osd_name(dev), namelen, name, (int)PTR_ERR(child)); - RETURN(0); + osd_name(dev), namelen, name, rc); + RETURN(rc); } else if (!child->d_inode) { dput(child); CDEBUG(D_INODE, "%s: child '%.*s' lacks inode\n", osd_name(dev), namelen, name); - RETURN(0); + RETURN(-ENOENT); } inode = child->d_inode; -- 1.8.3.1