Whamcloud - gitweb
LU-10395 osd: stop OI at device shutdown 53/38153/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 18 Feb 2020 15:04:44 +0000 (18:04 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jul 2020 07:27:54 +0000 (07:27 +0000)
and not at obd_cleanup(). otherwise a race is possible:
 umount <MDT> stopping OI vs MGS accessing same OSD which
results in the assertion:
ASSERTION( osd->od_oi_table != NULL && osd->od_oi_count >= 1 )

Lustre-change: https://review.whamcloud.com/37615
Lustre-commit: 2789978e1192dbf6d90399c96b5594e0dc049cd9

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I24fccea718f2e2663166cfb0ff26571039357535
Reviewed-on: https://review.whamcloud.com/38153
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_scrub.c

index 83afd3a..4c5793b 100644 (file)
@@ -7769,6 +7769,8 @@ static struct lu_device *osd_device_fini(const struct lu_env *env,
        osd_index_backup(env, o, false);
        osd_shutdown(env, o);
        osd_procfs_fini(o);
+       if (o->od_oi_table != NULL)
+               osd_oi_fini(osd_oti_get(env), o);
        osd_obj_map_fini(o);
        osd_umount(env, o);
 
index 62b1245..ded7c3f 100644 (file)
@@ -2779,8 +2779,6 @@ void osd_scrub_cleanup(const struct lu_env *env, struct osd_device *dev)
                dt_object_put_nocache(env, scrub->os_obj);
                scrub->os_obj = NULL;
        }
-       if (dev->od_oi_table != NULL)
-               osd_oi_fini(osd_oti_get(env), dev);
 }
 
 /* object table based iteration APIs */