From 2cfa3592b981b6c42d5fe8c569dd1fda6ce8c1ef Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Tue, 4 Mar 2025 14:08:41 -0800 Subject: [PATCH] LU-18773 osc: initialize index_orig in osc_brw_prep_request This patch initializes index_orig in osc_brw_prep_request() to fix the following error: In function 'osc_brw_prep_request': error: 'index_orig' may be used uninitialized in this function [-Werror=maybe-uninitialized] brwpg->pg->index = index_orig; ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ Change-Id: I97188ea21adfa25950814a04e4f6ffdb9b763712 Test-Parameters: trivial Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58296 Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/osc/osc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 456008a..b5b97f0 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1608,7 +1608,7 @@ osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 nunits = (brwpg->bp_off & ~PAGE_MASK) + brwpg->bp_count; struct address_space *map_orig = NULL; - pgoff_t index_orig; + pgoff_t index_orig = 0; retry_encrypt: nunits = round_up(nunits, LUSTRE_ENCRYPTION_UNIT_SIZE); -- 1.8.3.1