Whamcloud - gitweb
LU-15513 lod: skip uninit component in lod_fill_mirrors
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 2 Feb 2022 22:05:18 +0000 (15:05 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 9 Mar 2022 17:09:54 +0000 (17:09 +0000)
commitb7125e33cbdb3bca282e86f5fd8ad39047bf84e6
treeca9c7936b9dd03591f570f8e92870e1c59bacd10
parentd616c419e803cdd94e1587f5ba31aeec7faa02b0
LU-15513 lod: skip uninit component in lod_fill_mirrors

Do not iterate over the "objects" in lod_fill_mirrors() to check
for non-rotational OSTs if the component is uninitialized.  In
cases where an OST is not present (e.g. sparse OST indexes used)
the lod_tgt_desc[] array has holes and OST_TGT() returns NULL.

Skip the loop entirely if the component is not initialized, but
also add some sanity checks to verify that the OST index values
are sane in case there are other problems in the future (e.g.
corrupt/invalid layout on disk).

Lustre-change: https://review.whamcloud.com/46435
Lustre-commit: 591a990c617f9b953d2e838427d45fa1de061a83

Fixes: 8507472dd37e ("LU-14996 lov: prefer mirrors on non-rotational OSTs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I8ec23367059a4ec9e483adb768095b24f03ebbe5
Reviewed-on: https://review.whamcloud.com/46437
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/lod/lod_lov.c
lustre/tests/conf-sanity.sh