Whamcloud - gitweb
LU-12566 mdc: hold lock while walking changelog dev list 35/35835/2
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 1 Aug 2019 20:55:58 +0000 (14:55 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Sep 2019 03:52:18 +0000 (03:52 +0000)
commitb574f5f88878167b846a90ab09ac3b98958d52e4
treeda0a921b5b2dec62516ec3f036826c6b9cab2541
parenteaa0f5eb143ba005fbcc337a2ff07dafd1336402
LU-12566 mdc: hold lock while walking changelog dev list

In mdc_changelog_cdev_finish() we need chlg_registered_dev_lock
while walking and changing entries on the chlog_registered_devs
and ced_obds lists in chlg_registered_dev_find_by_obd().

Move the calling of chlg_registered_dev_find_by_obd() under the
mutex, and add assertions to the places where the lists are walked
and changed that the mutex is held.

Lustre-change: https://review.whamcloud.com/35668
Lustre-commit: a260c530801db7f58efa93b774f06b0ce72649a3

Fixes: 1d40214d96dd ("LU-7659 mdc: expose changelog through char devices")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib62fdff87cde6a4bcfb9bea24a2ea72a933ebbe5
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35835
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mdc/mdc_changelog.c