From 34255b2cfa39b8adc9c3e060065d1e5450b41200 Mon Sep 17 00:00:00 2001 From: fanyong Date: Wed, 15 Jul 2009 15:04:51 +0000 Subject: [PATCH] Branch b1_8 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 be5680c..bcfca6d 100644 --- a/lustre/lvfs/lustre_quota_fmt.c +++ b/lustre/lvfs/lustre_quota_fmt.c @@ -1054,6 +1054,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 06bd80a..433d130 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