Whamcloud - gitweb
LU-1812 ldiskfs: don't use sb->s_qf_inums
authorJeff Mahoney <jeffm@suse.com>
Mon, 4 Feb 2013 21:52:14 +0000 (16:52 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 10 Feb 2013 03:43:11 +0000 (22:43 -0500)
ext4-quota-first-class.patch was finally accepted into the mainline
Linux kernel via commit 7c319d32 (v3.6). The final version doesn't
include the cached inode numbers so they aren't available on newer
kernels that include this patch (or that are using an ldiskfs
patched using the usptream version).

Since the file system will refuse mounting when the inodes can't
be read, the lookup code isn't invoked without valid inode numbers

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: Ie1b824183cf734a0f242bb6483a192f1919dc4be
Reviewed-on: http://review.whamcloud.com/5264
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>

index 741516b..9e16533 100644 (file)
@@ -65,6 +65,10 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
                        const struct lu_fid *fid, struct osd_inode_id *id)
        struct super_block *sb = osd_sb(osd);
+        unsigned long qf_inums[2] = {
+               le32_to_cpu(LDISKFS_SB(sb)->s_es->s_usr_quota_inum),
+               le32_to_cpu(LDISKFS_SB(sb)->s_es->s_grp_quota_inum)
+       };
@@ -74,7 +78,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
        id->oii_gen = OSD_OII_NOGEN;
-       id->oii_ino = LDISKFS_SB(sb)->s_qf_inums[fid2type(fid)];
+       id->oii_ino = qf_inums[fid2type(fid)];
        if (!ldiskfs_valid_inum(sb, id->oii_ino))