From 796dc5eef5a2b420d001d84a43e4fd9d9d2b88e9 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Tue, 23 Mar 2010 11:37:00 -0700 Subject: [PATCH] b=22069 quota utils interoperability fix for HEAD. quota utils interoperability fix for HEAD. i=landen i=robert.read --- lustre/utils/lfs.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 6de2f29..6725737 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -1411,9 +1411,6 @@ static int lfs_quotaon(int argc, char **argv) rc = llapi_quotactl(mnt, &qctl); if (rc) { if (errno == EALREADY) { - fprintf(stderr, "\n%s quotas are enabled already.\n", - qctl.qc_type == 0x02 ? "user/group" : - (qctl.qc_type == 0x00 ? "user" : "group")); rc = 0; } else if (errno == ENOENT) { fprintf(stderr, "error: cannot find quota database, " @@ -1470,9 +1467,6 @@ static int lfs_quotaoff(int argc, char **argv) rc = llapi_quotactl(mnt, &qctl); if (rc) { if (errno == EALREADY) { - fprintf(stderr, "\n%s quotas are disabled already.\n", - qctl.qc_type == 0x02 ? "user/group" : - (qctl.qc_type == 0x00 ? "user" : "group")); rc = 0; } else { if (*obd_type) @@ -2144,17 +2138,18 @@ ug_output: return CMD_HELP; } - if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA) - print_quota_title(name, &qctl); - mnt = argv[optind]; rc1 = llapi_quotactl(mnt, &qctl); - if (rc1 == -1 && errno == EALREADY) { + if (rc1 == -1 && errno == ESRCH) { fprintf(stderr, "\n%s quotas are not enabled.\n", qctl.qc_type == USRQUOTA ? "user" : "group"); goto out; } + + if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA) + print_quota_title(name, &qctl); + if (rc1 && *obd_type) fprintf(stderr, "%s %s ", obd_type, obd_uuid); -- 1.8.3.1