Whamcloud - gitweb
LU-17084 lod: fix comparision in lod_striping_load() 65/52265/7
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 4 Sep 2023 17:30:26 +0000 (20:30 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Oct 2023 05:48:22 +0000 (05:48 +0000)
commitce54b5281c3172401ce4526a4de65d2d584fa0e7
treecdebdadc519ca3fcba656b7f5282d3011a7db56d
parent2b3371d5ee52c0fd915d0713c365a1cc53f51265
LU-17084 lod: fix comparision in lod_striping_load()

in if (rc > sizeof(struct lmv_foreign_md)) the latter
is unsigned and gcc treats rc (which is defined as int
and can be negative to encode an error) as unsigned.
this way -EIO becomes greater than the size of the
structure.  make sizeof() signed to avoid confusion.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ie6735578649e397ed05b6951fab941f97051305b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52265
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
lustre/lod/lod_lov.c