From: John L. Hammond Date: Tue, 21 May 2013 15:45:49 +0000 (-0500) Subject: LU-3300 lprocfs: interpret result of dt_statfs() correctly X-Git-Tag: 2.4.51~84 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=09b6f7b2f8832cca4dcf8378170438dcfd333beb LU-3300 lprocfs: interpret result of dt_statfs() correctly In a7369bcd860af61a073cb2424139e3acccdcb203, I accidentally reversed the sense of the error check after the call to dt_statfs() in lprocfs_dt_rd_{blksize,{files,kbytes}{free,avail}. Unreverse the error checking. Signed-off-by: John L. Hammond Change-Id: I91873f23cd69c2217474c26b9751aec259fae155 Reviewed-on: http://review.whamcloud.com/6385 Reviewed-by: Robert Read Tested-by: Hudson Reviewed-by: Emoly Liu Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index 61b2768..275674b 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -944,9 +944,9 @@ int lprocfs_dt_rd_blksize(char *page, char **start, off_t off, struct obd_statfs osfs; int rc = dt_statfs(NULL, dt, &osfs); - if (rc != 0) { + if (rc == 0) { *eof = 1; - rc = snprintf(page, count, "%d\n", + rc = snprintf(page, count, "%u\n", (unsigned) osfs.os_bsize); } @@ -961,7 +961,7 @@ int lprocfs_dt_rd_kbytestotal(char *page, char **start, off_t off, struct obd_statfs osfs; int rc = dt_statfs(NULL, dt, &osfs); - if (rc != 0) { + if (rc == 0) { __u32 blk_size = osfs.os_bsize >> 10; __u64 result = osfs.os_blocks; @@ -983,7 +983,7 @@ int lprocfs_dt_rd_kbytesfree(char *page, char **start, off_t off, struct obd_statfs osfs; int rc = dt_statfs(NULL, dt, &osfs); - if (rc != 0) { + if (rc == 0) { __u32 blk_size = osfs.os_bsize >> 10; __u64 result = osfs.os_bfree; @@ -1005,7 +1005,7 @@ int lprocfs_dt_rd_kbytesavail(char *page, char **start, off_t off, struct obd_statfs osfs; int rc = dt_statfs(NULL, dt, &osfs); - if (rc != 0) { + if (rc == 0) { __u32 blk_size = osfs.os_bsize >> 10; __u64 result = osfs.os_bavail; @@ -1027,7 +1027,7 @@ int lprocfs_dt_rd_filestotal(char *page, char **start, off_t off, struct obd_statfs osfs; int rc = dt_statfs(NULL, dt, &osfs); - if (rc != 0) { + if (rc == 0) { *eof = 1; rc = snprintf(page, count, LPU64"\n", osfs.os_files); } @@ -1043,7 +1043,7 @@ int lprocfs_dt_rd_filesfree(char *page, char **start, off_t off, struct obd_statfs osfs; int rc = dt_statfs(NULL, dt, &osfs); - if (rc != 0) { + if (rc == 0) { *eof = 1; rc = snprintf(page, count, LPU64"\n", osfs.os_ffree); }