Whamcloud - gitweb
LU-17000 utils: Add check after calling sysconf(_SC_PAGESIZE) 93/53693/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Wed, 17 Jan 2024 09:34:25 +0000 (15:04 +0530)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:32:16 +0000 (08:32 +0000)
commitb02a9bc1bf1af07cf7784f7f19ce10dc55b7bedb
tree17a48d4d016e6d1e65e2bd155f6f5211a8884019
parent966c6bc7a2514737c04b579cdb4a985c99ae6658
LU-17000 utils: Add check after calling sysconf(_SC_PAGESIZE)

Calling sysconf(_SC_PAGESIZE) could return -1
on error. This patch adds check after calling
sysconf() instead of directly using the value

Test-Parameters: trivial testlist=sanity-flr
CoverityID: 397578 ("Argument cannot be negative")
CoverityID: 397246 ("Argument cannot be negative")
CoverityID: 397320 ("Argument cannot be negative")
CoverityID: 397671 ("Argument cannot be negative")
CoverityID: 397826 ("Argument cannot be negative")
CoverityID: 397898 ("Argument cannot be negative")
CoverityID: 397917 ("Argument cannot be negative")
CoverityID: 399702 ("Argument cannot be negative")
Fixes: 0561c144 (LU-13397 lfs: mirror extend/copy keeps sparseness)
Fixes: a5905b2a (LU-11245 flr: lfs mirror dump command)
Fixes: f1daa8fc (LU-10287 flr: lfs mirror verify command)
Fixes: 0e5c12ac (LU-10916 lfs: improve lfs mirror resync)
Fixes: 5d7c4fa6 (LU-9771 flr: mirror read and write)
Fixes: 5999c0b8 (LU-9771 flr: resync support and test tool)
Fixes: 9b44cf70 (LU-13224 utils: expose llapi_param* functions)
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I19d13528f63d4586a17aaa9d15313872f8c40c94
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53693
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lfs.c
lustre/utils/liblustreapi_layout.c
lustre/utils/liblustreapi_mirror.c
lustre/utils/liblustreapi_param.c