Whamcloud - gitweb
LU-14831 osd-ldiskfs: uninited osd_inode_id is used 49/44349/3
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 30 Jun 2021 11:15:03 +0000 (19:15 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 Oct 2021 00:36:55 +0000 (00:36 +0000)
In osd_fid_lookup, the "osd_inode_id" could be used uninitializedly
if the FID doesn't exist in OI, which cause some faked FID/inode
pair to be inserted into OI file and the OI scrub thread could be
triggered repeatedly.

Change-Id: I9100dece9e94d3e590f17fb4498601876aa1edaa
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44349
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 2bfd3b5..1b94f32 100644 (file)
@@ -1158,6 +1158,7 @@ static int osd_fid_lookup(const struct lu_env *env, struct osd_object *obj,
        }
 
        id = &info->oti_id;
+       memset(id, 0, sizeof(struct osd_inode_id));
        if (!list_empty(&scrub->os_inconsistent_items)) {
                /* Search order: 2. OI scrub pending list. */
                result = osd_oii_lookup(dev, fid, id);