Whamcloud - gitweb
LU-957 revert OI scrub patch
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_oi.c
index cfd308b..3e3279a 100644 (file)
@@ -456,8 +456,11 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
                 id->oii_ino = inode->i_ino;
                 id->oii_gen = inode->i_generation;
         } else {
-               if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
-                       return osd_compat_spec_lookup(info, osd, fid, id);
+                if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
+                        rc = osd_compat_spec_lookup(info, osd, fid, id);
+                        if (rc == 0 || rc != -ERESTART)
+                                goto out;
+                }
 
                 fid_cpu_to_be(oi_fid, fid);
                 key = (struct dt_key *)oi_fid;
@@ -473,6 +476,8 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
                         rc = -ENOENT;
                 }
         }
+
+out:
         return rc;
 }
 
@@ -530,15 +535,15 @@ int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
         struct osd_inode_id *id;
         const struct dt_key *key;
 
-       if (fid_is_igif(fid) || unlikely(fid_seq(fid) == FID_SEQ_DOT_LUSTRE))
-               return 0;
+        if (fid_is_igif(fid))
+                return 0;
 
-       if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)
-               return osd_compat_objid_insert(info, osd, fid, id0, th);
+        if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)
+                return osd_compat_objid_insert(info, osd, fid, id0, th);
 
-       /* Server mount should not depends on OI files */
-       if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
-               return osd_compat_spec_insert(info, osd, fid, id0, th);
+        /* notice we don't return immediately, but continue to get into OI */
+        if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
+                osd_compat_spec_insert(info, osd, fid, id0, th);
 
         fid_cpu_to_be(oi_fid, fid);
         key = (struct dt_key *)oi_fid;
@@ -584,6 +589,9 @@ int osd_oi_delete(struct osd_thread_info *info,
         struct lu_fid       *oi_fid = &info->oti_fid;
         const struct dt_key *key;
 
+        if (!fid_is_norm(fid))
+                return 0;
+
         LASSERT(fid_seq(fid) != FID_SEQ_LOCAL_FILE);
 
         if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)