Whamcloud - gitweb
LU-11457 osd-ldiskfs: scrub FID reuse 01/51601/7
authorLai Siyao <lai.siyao@whamcloud.com>
Fri, 7 Jul 2023 09:21:05 +0000 (05:21 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 31 Aug 2023 06:16:57 +0000 (06:16 +0000)
commit5c59f8551a96ec0b3bbb935a3173c75e878d9ff0
treeb98906e5872ae63ea6cd2dc1b6309e1102d0e965
parentd69b511af6a131087061fb3327cbf665f6d6815e
LU-11457 osd-ldiskfs: scrub FID reuse

It's possible that two inodes back point to the same FID, check
inodes in osd_scrub_check_update() to decide which mapping
should be kept:
* if one inode doesn't exist, its mapping is stale.
* if one inode mtime is after the other one, keep this mapping.
* if two inode mtimes equal, and one inode size is not 0, keep its
  mapping, otherwise two inode sizes are 0, just keep the existing
  mapping.

Remove IDIF support in osd_scrub_check_update() to simplify
code logic.

Add sanity-scrub 4e to verify it.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ida020c2852c66f1a8910845bd16ab4c882858a4e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51601
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_support.h
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_scrub.c
lustre/tests/sanity-scrub.sh [changed mode: 0644->0755]