Whamcloud - gitweb
LU-9836 osd-ldiskfs: read directory completely 19/31019/2
authorFan Yong <fan.yong@intel.com>
Tue, 16 Jan 2018 03:21:05 +0000 (11:21 +0800)
committerJohn L. Hammond <john.hammond@intel.com>
Fri, 9 Feb 2018 18:21:17 +0000 (18:21 +0000)
commitfc862c92d8cad04bceea68823d136d9d8678cc98
treee5090b965084b825fa11321db281eaa336523298
parent823e1549f109412db4a8cb31e648819660c5f7b8
LU-9836 osd-ldiskfs: read directory completely

For ldiskfs backend, the return of readdir() does NOT means
the whole directory being read. Instead, it is the caller's
duty to count whether there are new items read via the last
readdir() then determine whether or not the whole directroy
has been read.

Unfortunately, some old osd-ldiskfs logic, such as OI scrub,
did not handle that properly, as to some directory, such as
lost+found, may be partly scanned. That is why some orphans
cannot be recovered.

Lustre-change: https://review.whamcloud.com/30770
Lustre-commit: 1e2cd1c7025080879a27f9ad9a3896fd3e0e8753

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ib328643c4cdcdb14b548807ed05e8835f80bbf6a
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/31019
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_scrub.c
lustre/tests/sanity-scrub.sh