From: Mikhail Pershin Date: Fri, 4 Dec 2020 12:06:37 +0000 (+0300) Subject: LU-14174 lfs: llapi_mirror_find() signed return X-Git-Tag: 2.14.56~141 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F41757%2F7;p=fs%2Flustre-release.git LU-14174 lfs: llapi_mirror_find() signed return Check return codes from llapi_mirror_find() as signed value to don't count errors as valid mirror ids Signed-off-by: Mikhail Pershin Change-Id: I9754eaa063c9a2d07d8b815a86e7597922201f9c Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/41757 Tested-by: jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- diff --git a/lustre/include/lustre/lustreapi.h b/lustre/include/lustre/lustreapi.h index 427cf6a..2cf1669 100644 --- a/lustre/include/lustre/lustreapi.h +++ b/lustre/include/lustre/lustreapi.h @@ -683,9 +683,8 @@ struct llapi_layout; int llapi_mirror_truncate(int fd, unsigned int id, off_t length); ssize_t llapi_mirror_write(int fd, unsigned int id, const void *buf, size_t count, off_t pos); -uint32_t llapi_mirror_find(struct llapi_layout *layout, - uint64_t file_start, uint64_t file_end, - uint64_t *endp); +int llapi_mirror_find(struct llapi_layout *layout, uint64_t file_start, + uint64_t file_end, uint64_t *endp); int llapi_layout_get_last_init_comp(struct llapi_layout *layout); int llapi_layout_mirror_inherit(struct llapi_layout *f_layout, struct llapi_layout *m_layout); diff --git a/lustre/utils/liblustreapi_layout.c b/lustre/utils/liblustreapi_layout.c index f4d6587..f107d27 100644 --- a/lustre/utils/liblustreapi_layout.c +++ b/lustre/utils/liblustreapi_layout.c @@ -2856,9 +2856,8 @@ error: } /* locate @layout to a valid component covering file [file_start, file_end) */ -uint32_t llapi_mirror_find(struct llapi_layout *layout, - uint64_t file_start, uint64_t file_end, - uint64_t *endp) +int llapi_mirror_find(struct llapi_layout *layout, uint64_t file_start, + uint64_t file_end, uint64_t *endp) { uint32_t mirror_id = 0; int rc;