Whamcloud - gitweb
LU-13729 osd-ldiskfs: race access to iam_formats during setup 56/44356/2
authorWang Shilong <wshilong@ddn.com>
Tue, 30 Jun 2020 01:12:48 +0000 (09:12 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 10 Aug 2021 06:35:09 +0000 (06:35 +0000)
commit04dee5aec86e6044c264ee46489e8188bacb4d82
treee070d73d89519e1a8475a9c8c411b48ac0c0a058
parent5b7627beef0c35a0fc47a416c5fbb9bbf2933f3a
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.

Lustre-change: https://review.whamcloud.com/39213
Lustre-commit: 54d0f5de911af52e7f2a978c4b6cd158fed87dc5

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I6dd5a4d1297792b47fb4b94052465a7e0f9123aa
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/44356
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wangshilong1991@gmail.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