Whamcloud - gitweb
LU-6147 lfsck: NOT purge object by OI scrub
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_scrub.c
index fdfab11..a9a191d 100644 (file)
@@ -582,9 +582,6 @@ iget:
                        sf->sf_items_updated_prior++;
                else
                        sf->sf_items_updated++;
-
-               /* The target has been changed, need to be re-loaded. */
-               lu_object_purge(info->oti_env, osd2lu_dev(dev), fid);
        }
 
        GOTO(out, rc);
@@ -975,10 +972,11 @@ static int osd_scrub_next(struct osd_thread_info *info, struct osd_device *dev,
                struct l_wait_info lwi;
 
                lwi = LWI_TIMEOUT(cfs_time_seconds(cfs_fail_val), NULL, NULL);
-               l_wait_event(thread->t_ctl_waitq,
-                            !list_empty(&scrub->os_inconsistent_items) ||
-                            !thread_is_running(thread),
-                            &lwi);
+               if (likely(lwi.lwi_timeout > 0))
+                       l_wait_event(thread->t_ctl_waitq,
+                               !list_empty(&scrub->os_inconsistent_items) ||
+                               !thread_is_running(thread),
+                               &lwi);
        }
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OSD_SCRUB_CRASH)) {
@@ -1559,7 +1557,7 @@ static const struct osd_lf_map osd_lf_maps[] = {
        { "PENDING", { 0, 0, 0 }, 0, NULL, NULL },
 
        /* ROOT */
-       { "ROOT", { FID_SEQ_ROOT, 1, 0 },
+       { "ROOT", { FID_SEQ_ROOT, FID_OID_ROOT, 0 },
                OLF_SCAN_SUBITEMS | OLF_HIDE_FID, osd_ios_ROOT_scan, NULL },
 
        /* changelog_catalog */
@@ -1965,7 +1963,7 @@ osd_ios_general_scan(struct osd_thread_info *info, struct osd_device *dev,
                                                .oifb_info = info,
                                                .oifb_dev = dev,
                                                .oifb_dentry = dentry };
-       struct file                  *filp  = &info->oti_it_ea.oie_file;
+       struct file                  *filp  = &info->oti_file;
        struct inode                 *inode = dentry->d_inode;
        const struct file_operations *fops  = inode->i_fop;
        int                           rc;
@@ -2220,7 +2218,8 @@ static int do_osd_scrub_start(struct osd_device *dev, __u32 flags)
 again:
        if (thread_is_running(thread)) {
                spin_unlock(&scrub->os_lock);
-               if (!scrub->os_partial_scan || flags & SS_AUTO_PARTIAL)
+               if (!(scrub->os_file.sf_flags & SF_AUTO) ||
+                    (flags & (SS_AUTO_FULL | SS_AUTO_PARTIAL)))
                        RETURN(-EALREADY);
 
                osd_scrub_join(dev, flags, false);