Whamcloud - gitweb
LU-11457 osd-ldiskfs: scrub FID reuse 01/51601/6
authorLai Siyao <lai.siyao@whamcloud.com>
Fri, 7 Jul 2023 09:21:05 +0000 (05:21 -0400)
committerLai Siyao <lai.siyao@whamcloud.com>
Mon, 21 Aug 2023 14:23:14 +0000 (10:23 -0400)
commitdc53daaaf9e158355edb8f6021123fed9a1429ef
treed9df139847e1f88c93952e95399e467c9cb52cb7
parentaa8df6a4a3f50dc86554764f6ccb72db027633f8
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
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]