Whamcloud - gitweb
LU-17084 lod: fix comparision in lod_striping_load()
authorhxing <hxing@ddn.com>
Tue, 17 Oct 2023 07:20:12 +0000 (15:20 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 19 Oct 2023 12:49:44 +0000 (12:49 +0000)
commitc22322cede6186b39e617d7a0ecfef3c41e0d1c5
treeff312a62d5f6a433eeb8558f596c763cb47d1018
parent3c2f4f484f4ebae144d2bef663014b94394aa608
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.

Lustre-change: https://review.whamcloud.com/52265
Lustre-commit: ce54b5281c3172401ce4526a4de65d2d584fa0e7

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: Xing Huang <hxing@ddn.com>
Change-Id: Ie6735578649e397ed05b6951fab941f97051305b
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52721
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/lod/lod_lov.c