From b6c90c28d2ff2255449ab6995d217edaf972a462 Mon Sep 17 00:00:00 2001 From: fanyong Date: Wed, 15 Jul 2009 14:17:19 +0000 Subject: [PATCH] Branch b1_6 b=20002 i=tianzy i=robert.read Check "auto_quota_on()" return value before "build_lqs()" called. --- lustre/lvfs/lustre_quota_fmt.c | 2 ++ lustre/quota/lproc_quota.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lustre/lvfs/lustre_quota_fmt.c b/lustre/lvfs/lustre_quota_fmt.c index 2351548..494062b 100644 --- a/lustre/lvfs/lustre_quota_fmt.c +++ b/lustre/lvfs/lustre_quota_fmt.c @@ -1046,6 +1046,8 @@ int lustre_get_qids(struct file *fp, struct inode *inode, int type, ENTRY; + LASSERT(ergo(fp == NULL, inode != NULL)); + if (check_quota_file(fp, inode, type, LUSTRE_QUOTA_V1) == 0) version = LUSTRE_QUOTA_V1; else if (check_quota_file(fp, inode, type, LUSTRE_QUOTA_V2) == 0) diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index bcc2cd2..077fe6d 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -412,8 +412,12 @@ int lprocfs_quota_wr_type(struct file *file, const char *buffer, } if (type != 0) { - auto_quota_on(obd, type - 1, obt->obt_sb, is_mds); - build_lqs(obd); + int rc = auto_quota_on(obd, type - 1, obt->obt_sb, is_mds); + + if (rc == 0) + build_lqs(obd); + else if (rc != -EALREADY) + return rc; } return count; -- 1.8.3.1