Whamcloud - gitweb
LU-18773 osc: initialize index_orig in osc_brw_prep_request 96/58296/2
authorJian Yu <yujian@whamcloud.com>
Tue, 4 Mar 2025 22:08:41 +0000 (14:08 -0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Mar 2025 17:08:43 +0000 (17:08 +0000)
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 <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58296
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osc/osc_request.c

index 456008a..b5b97f0 100644 (file)
@@ -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);