From 7cf2e3c0ed2f29cdefc0543c619788d01423de58 Mon Sep 17 00:00:00 2001 From: tianzy Date: Fri, 21 Aug 2009 06:54:18 +0000 Subject: [PATCH] Branch HEAD fix a bug which is triggered when mdt.quota_type or ost.quota_type is set and there is not any quota set before. b=19442 i=johann i=panda --- lustre/lvfs/lustre_quota_fmt.c | 6 ++++++ lustre/quota/quota_context.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lustre/lvfs/lustre_quota_fmt.c b/lustre/lvfs/lustre_quota_fmt.c index e782624..0488c2c 100644 --- a/lustre/lvfs/lustre_quota_fmt.c +++ b/lustre/lvfs/lustre_quota_fmt.c @@ -97,6 +97,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_context.c b/lustre/quota/quota_context.c index 29e2f3a..440ddf8 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -1496,6 +1496,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); -- 1.8.3.1