Whamcloud - gitweb
LU-14831 osd-ldiskfs: uninited osd_inode_id is used
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 30 Jun 2021 11:15:03 +0000 (19:15 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 22 Jul 2021 01:56:21 +0000 (01:56 +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.

Lustre-change: https://review.whamcloud.com/44349
Lustre-commit: TBD (from fd0330f95dc2b1d4f10dd137dc0bfaa7ebbf0dfb)

Change-Id: I9100dece9e94d3e590f17fb4498601876aa1edaa
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44350
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index e756975..9556b5b 100644 (file)
@@ -1150,6 +1150,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);