Whamcloud - gitweb
LU-91 Fix quota format problem with RHEL6 and kernels >= 2.6.33
authorJohann Lombardi <johann@whamcloud.com>
Mon, 28 Feb 2011 14:49:21 +0000 (15:49 +0100)
committerOleg Drokin <green@whamcloud.com>
Thu, 24 Mar 2011 17:48:26 +0000 (10:48 -0700)
Since kernel commit 869835dfad3eb6f7d90c3255a24b084fea82f30d "quota: Improve
checking of quota file header", quota users now have to specify what
format they want to use and an error is returned if it does not match the
one used on disk.
Since we only support the 64-bit quota format with lustre 2.x, we should
just use QFMT_VFS_V1 instead of QFMT_VFS_V0 (which should still be used
for older kernels like RHEL5).

Change-Id: I9022073385c76dafbf698fbdf2df58de38535d88
Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/268
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Hudson
lustre/lvfs/fsfilt_ext3.c

index 8b60e31..afae10d 100644 (file)
 # define V2_DQTREEOFF    QT_TREEOFF
 #endif
 
+#ifdef QFMT_VFS_V1
+#define QFMT_LUSTRE QFMT_VFS_V1
+#else
+#define QFMT_LUSTRE QFMT_VFS_V0
+#endif
+
 #if defined(HAVE_EXT3_XATTR_H)
 #include <ext3/xattr.h>
 #else
@@ -1436,7 +1442,7 @@ static int fsfilt_ext3_setup(struct super_block *sb)
                 sbi->s_qf_names[USRQUOTA] = NULL;
                 return -ENOMEM;
         }
-        sbi->s_jquota_fmt = QFMT_VFS_V0;
+        sbi->s_jquota_fmt = QFMT_LUSTRE;
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13))
         set_opt(sbi->s_mount_opt, QUOTA);
 #endif
@@ -1532,7 +1538,7 @@ static int fsfilt_ext3_quotactl(struct super_block *sb,
 
                                 LASSERT(oqc->qc_id == LUSTRE_QUOTA_V2);
 
-                                rc = ll_quota_on(sb, i, QFMT_VFS_V0,
+                                rc = ll_quota_on(sb, i, QFMT_LUSTRE,
                                                  name[i], 0);
                         } else if (oqc->qc_cmd == Q_QUOTAOFF) {
                                 rc = ll_quota_off(sb, i, 0);