Whamcloud - gitweb
LU-9806 obdclass: wait for all exports to go 47/50147/11
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 27 Feb 2023 18:40:34 +0000 (21:40 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jul 2023 16:41:40 +0000 (16:41 +0000)
commit08f9ebe93b300c39d2af1fb8e82a22e9c84f401b
treed38712c9e415df138df1d80822783c80aa6d8260
parent77362aa952b202529d95d5789ed0014b69d40fb8
LU-9806 obdclass: wait for all exports to go

obd_zombie_export_add() removes an export from the stale list
and then schedules a job to destroy that export. in this short
window ofd_fini()/mdt_fini() can find obd_linked_exports list
empty and no work in zombie work queue. then the obd is being
removed and concurrent export destroy may find the obd in a
unexpected state:
LustreError: 11166:0:(tgt_lastrcvd.c:469:tgt_client_free())
ASSERTION( lut && lut->lut_client_bitmap ) failed

use obd_stale_export_num counter to block in obd_zombie_barrier.

move atomic_inc() from class_unlink_export to obd_export_zombie_add()
as self-exports are not added to the stale list. I

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I62ed019f86becd3c66f5fcdf991f13cd47466e5e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50147
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/genops.c