From: tianzy Date: Thu, 14 May 2009 07:15:29 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_2_01~1^2~445 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0902ec4ca7bb2027f41dcab2214911d04bd568c2;p=fs%2Flustre-release.git Branch b1_8 fix the problem when mdt.quota_type or ost.quota_type is set and there is not any quota set before b=19442 i=johann i=panda --- diff --git a/lustre/lvfs/lustre_quota_fmt.c b/lustre/lvfs/lustre_quota_fmt.c index 2351548..f1abc3a 100644 --- a/lustre/lvfs/lustre_quota_fmt.c +++ b/lustre/lvfs/lustre_quota_fmt.c @@ -104,6 +104,12 @@ int check_quota_file(struct file *f, struct inode *inode, int type, static const uint quota_magics[] = LUSTRE_INITQMAGICS; const uint *quota_versions = lustre_initqversions[version]; + if (!inode && !f) { + CERROR("check_quota_file failed!\n"); + libcfs_debug_dumpstack(NULL); + return -EINVAL; + } + if (f) { fs = get_fs(); set_fs(KERNEL_DS); diff --git a/lustre/quota/quota_ctl.c b/lustre/quota/quota_ctl.c index 1da7765..945f075 100644 --- a/lustre/quota/quota_ctl.c +++ b/lustre/quota/quota_ctl.c @@ -78,6 +78,9 @@ void build_lqs(struct obd_device *obd) for (i = 0; i < MAXQUOTAS; i++) { struct dquot_id *dqid, *tmp; + if (sb_dqopt(qctxt->lqc_sb)->files[i] == NULL) + continue; + #ifndef KERNEL_SUPPORTS_QUOTA_READ rc = fsfilt_qids(obd, sb_dqopt(qctxt->lqc_sb)->files[i], NULL, i, &id_list);