Whamcloud - gitweb
Branch b1_8
authorfanyong <fanyong>
Wed, 15 Jul 2009 15:04:51 +0000 (15:04 +0000)
committerfanyong <fanyong>
Wed, 15 Jul 2009 15:04:51 +0000 (15:04 +0000)
b=20002
i=tianzy
i=robert.read

Check "auto_quota_on()" return value before "build_lqs()" called.

lustre/lvfs/lustre_quota_fmt.c
lustre/quota/lproc_quota.c

index be5680c..bcfca6d 100644 (file)
@@ -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)
index 06bd80a..433d130 100644 (file)
@@ -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;