Whamcloud - gitweb
LU-957 scrub: Ancillary work for LFSCK/OI scrub
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_oi.c
index 587a8dc..d5f7a31 100644 (file)
@@ -453,11 +453,8 @@ 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)) {
-                        rc = osd_compat_spec_lookup(info, osd, fid, id);
-                        if (rc == 0 || rc != -ERESTART)
-                                goto out;
-                }
+               if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE))
+                       return osd_compat_spec_lookup(info, osd, fid, id);
 
                 fid_cpu_to_be(oi_fid, fid);
                 key = (struct dt_key *)oi_fid;
@@ -473,8 +470,6 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
                         rc = -ENOENT;
                 }
         }
-
-out:
         return rc;
 }
 
@@ -525,22 +520,22 @@ static int osd_oi_iam_insert(struct osd_thread_info *oti, struct osd_oi *oi,
 }
 
 int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd,
-                  const struct lu_fid *fid, const struct osd_inode_id *id0,
-                  struct thandle *th, int ignore_quota)
+                 const struct lu_fid *fid, const struct osd_inode_id *id0,
+                 struct thandle *th, int ignore_quota)
 {
-        struct lu_fid       *oi_fid = &info->oti_fid;
-        struct osd_inode_id *id;
-        const struct dt_key *key;
+       struct lu_fid       *oi_fid = &info->oti_fid;
+       struct osd_inode_id *id;
+       const struct dt_key *key;
 
-        if (fid_is_igif(fid))
-                return 0;
+       if (fid_is_igif(fid) || unlikely(fid_seq(fid) == FID_SEQ_DOT_LUSTRE))
+               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);
 
-        /* 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);
+       /* 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);
 
         fid_cpu_to_be(oi_fid, fid);
         key = (struct dt_key *)oi_fid;
@@ -586,9 +581,6 @@ 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)