Whamcloud - gitweb
LU-15513 lod: skip uninit component in lod_fill_mirrors 35/46435/5
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 2 Feb 2022 22:05:18 +0000 (15:05 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 5 Mar 2022 20:43:12 +0000 (20:43 +0000)
commit591a990c617f9b953d2e838427d45fa1de061a83
tree25c66865442341a48985c034c414607187ddd07e
parentc185410b0007f841962979f8d6c367db9c48c2a3
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).

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/46435
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lod_lov.c
lustre/tests/conf-sanity.sh