Whamcloud - gitweb
LU-11457 osd-ldiskfs: scrub FID reuse
authorLai Siyao <lai.siyao@whamcloud.com>
Fri, 7 Jul 2023 09:21:05 +0000 (05:21 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 14 Sep 2023 07:25:19 +0000 (07:25 +0000)
commite07115c36ab5173294016fc7f21c5875e959daa3
treea85d17d8e4378ec191710bf68e968ca8ff9de0b9
parent02a1f63b4ee5b93f6438b9481cf6ce89139eea2b
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.

Lustre-change: https://review.whamcloud.com/51601
Lustre-commit: dc53daaaf9e158355edb8f6021123fed9a1429ef (TBD)

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ida020c2852c66f1a8910845bd16ab4c882858a4e
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52037
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@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]