Whamcloud - gitweb
LU-8066 mdc: move mdc-specific procfs files to sysfs
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_quota.c
index 3c250ba..7e15425 100644 (file)
@@ -72,8 +72,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
        ENTRY;
        LASSERT(fid_is_acct(fid));
 
-       if (!LDISKFS_HAS_RO_COMPAT_FEATURE(sb,
-                                          LDISKFS_FEATURE_RO_COMPAT_QUOTA))
+       if (!ldiskfs_has_feature_quota(sb))
                RETURN(-ENOENT);
 
        id->oii_gen = OSD_OII_NOGEN;
@@ -88,8 +87,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
                break;
        case PRJQUOTA:
  #ifdef HAVE_PROJECT_QUOTA
-               if (LDISKFS_HAS_RO_COMPAT_FEATURE(sb,
-                                       LDISKFS_FEATURE_RO_COMPAT_PROJECT))
+               if (ldiskfs_has_feature_project(sb))
                        id->oii_ino =
                                le32_to_cpu(LDISKFS_SB(sb)->s_es->s_prj_quota_inum);
                else
@@ -437,7 +435,17 @@ static __u64 osd_it_acct_store(const struct lu_env *env,
 static int osd_it_acct_load(const struct lu_env *env,
                            const struct dt_it *di, __u64 hash)
 {
+       struct osd_it_quota *it = (struct osd_it_quota *)di;
+
        ENTRY;
+
+       /* LU-8999 - If it is called to resume the iteration, calling
+        * osd_it_acct_get could change the block orders in the lower level
+        * of the quota tree, which are saved in osd_it_quota->oiq_blk.
+        * */
+       if (it->oiq_id != 0 && it->oiq_id == hash)
+               RETURN(1);
+
        RETURN(osd_it_acct_get(env, (struct dt_it *)di,
                               (const struct dt_key *)&hash));
 }