Whamcloud - gitweb
LU-2059 llog: MGC to use OSD API for backup logs
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_scrub.c
index 72ed5b8..98a3b24 100644 (file)
@@ -1021,7 +1021,7 @@ static int osd_scrub_main(void *args)
        int                   rc;
        ENTRY;
 
        int                   rc;
        ENTRY;
 
-       rc = lu_env_init(&env, LCT_DT_THREAD);
+       rc = lu_env_init(&env, LCT_LOCAL);
        if (rc != 0) {
                CERROR("%.16s: OI scrub, fail to init env, rc = %d\n",
                       LDISKFS_SB(sb)->s_es->s_volume_name, rc);
        if (rc != 0) {
                CERROR("%.16s: OI scrub, fail to init env, rc = %d\n",
                       LDISKFS_SB(sb)->s_es->s_volume_name, rc);
@@ -1796,6 +1796,13 @@ int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev)
                        rc = osd_scrub_start(dev);
        }
 
                        rc = osd_scrub_start(dev);
        }
 
+       /* it is possible that dcache entries may keep objects after they are
+        * deleted by OSD. While it looks safe this can cause object data to
+        * stay until umount causing failures in tests calculating free space,
+        * e.g. replay-ost-single. Since those dcache entries are not used
+        * anymore let's just free them after use here */
+       shrink_dcache_sb(sb);
+
        RETURN(rc);
 }
 
        RETURN(rc);
 }