[lustre-devel] [PATCH 13/38] lustre: llite: don't handle success case for blocksize sysfs code

James Simmons jsimmons at infradead.org
Thu Aug 16 20:10:16 PDT 2018


The proper thing to due is return on failure so reverse the logic
to conform to kernel standards.

Signed-off-by: James Simmons <uja.ornl at yahoo.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-8066
Reviewed-on: https://review.whamcloud.com/32496
Reviewed-by: John L. Hammond <jhammond at whamcloud.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 2a76c01..7bd557b 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -141,10 +141,10 @@ static ssize_t blocksize_show(struct kobject *kobj, struct attribute *attr,
 	rc = ll_statfs_internal(sbi, &osfs,
 				get_jiffies_64() - OBD_STATFS_CACHE_SECONDS * HZ,
 				OBD_STATFS_NODELAY);
-	if (!rc)
-		return sprintf(buf, "%u\n", osfs.os_bsize);
+	if (rc)
+		return rc;
 
-	return rc;
+	return sprintf(buf, "%u\n", osfs.os_bsize);
 }
 LUSTRE_RO_ATTR(blocksize);
 
-- 
1.8.3.1



More information about the lustre-devel mailing list