Skip to content

Commit

Permalink
staging/lustre/lprocfs: interpret result of dt_statfs() correctly
Browse files Browse the repository at this point in the history
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.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3300
Lustre-change: http://review.whamcloud.com/6385
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Robert Read <robert.read@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
John L. Hammond authored and Greg Kroah-Hartman committed Jun 5, 2013
1 parent 2bbf233 commit 6715e39
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/staging/lustre/lustre/obdclass/dt_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 6715e39

Please sign in to comment.