Whamcloud - gitweb
LU-13729 osd-ldiskfs: race access to iam_formats during setup 13/39213/2
authorWang Shilong <wshilong@ddn.com>
Tue, 30 Jun 2020 01:12:48 +0000 (09:12 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jul 2020 16:53:13 +0000 (16:53 +0000)
commit54d0f5de911af52e7f2a978c4b6cd158fed87dc5
tree8a585823262c41c4a9e98333ac241610f9049082
parent07397a2e7473cd1e524c24d18774accf05adf8ad
LU-13729 osd-ldiskfs: race access to iam_formats during setup

It might be possible during OST mounting, two targets reach
iam_format_guess() at the same time, if @initialized is 0,
they both access iam_lxx_format_init(), however list operation
inside is not protected by any locking which cause list corruptions
finally.

We could fix this by doing formats registration in module init,
since there are only two formats, just remove pointless list.

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I6dd5a4d1297792b47fb4b94052465a7e0f9123aa
Reviewed-on: https://review.whamcloud.com/39213
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_iam.c
lustre/osd-ldiskfs/osd_iam.h
lustre/osd-ldiskfs/osd_iam_lfix.c
lustre/osd-ldiskfs/osd_iam_lvar.c