Whamcloud - gitweb
LU-9836 osd-ldiskfs: read directory completely 70/30770/8
authorFan Yong <fan.yong@intel.com>
Tue, 16 Jan 2018 03:21:05 +0000 (11:21 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 25 Jan 2018 04:45:51 +0000 (04:45 +0000)
commit1e2cd1c7025080879a27f9ad9a3896fd3e0e8753
tree566b60ac137ee8cbbe68bf36cbcf028e15940f53
parentc62ba699c51237ae1a04b59dd23201d8fe852a67
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.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ib328643c4cdcdb14b548807ed05e8835f80bbf6a
Reviewed-on: https://review.whamcloud.com/30770
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_scrub.c
lustre/tests/sanity-scrub.sh