From 59fc4de63f7589b8286a1230ca39b06315f93b3b Mon Sep 17 00:00:00 2001 From: James Nunez Date: Wed, 5 Feb 2014 10:15:29 -0700 Subject: [PATCH] LU-4554 lfsck: old single-OI MDT always scrubbed Old ldiskfs MDT's that contain a single OI container named "oi.16" trigger an automatic OI scrub on each restart. This is because osd_oi_table_open() gets ENOENT opening "oi.16.0" and consequently sets bit 0 in scrub_file::sf_oi_bitmap. This bit indicates the OI container 0 needs to be recreated, and it triggers a scrub in osd_fid_lookup() for lookups that fail with ENOENT. Fix this by clearing the bit in osd_oi_init() after a successful open of "oi.16". Lustre-change: http://review.whamcloud.com/#/c/9067 Lustre-commit: b4159f5d722bc43cff82b4c45336b01fd769e1db Signed-off-by: Ned Bass Signed-off-by: James Nunez Change-Id: I3f19b15b51fce85bf791df76389f0b28951356c3 Reviewed-on: http://review.whamcloud.com/9139 Tested-by: Jenkins Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger --- lustre/osd-ldiskfs/osd_oi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index a7d8581..2fdb3cb 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -368,6 +368,7 @@ int osd_oi_init(struct osd_thread_info *info, struct osd_device *osd) /* if previous failed then try found single OI from old filesystem */ rc = osd_oi_open(info, osd, OSD_OI_NAME_BASE, &oi[0], false); if (rc == 0) { /* found single OI from old filesystem */ + ldiskfs_clear_bit(0, sf->sf_oi_bitmap); if (sf->sf_success_count == 0) /* XXX: There is one corner case that if the OI_scrub * file crashed or lost and we regard it upgrade, -- 1.8.3.1