Re: [PATCH 5/7] xfs: abort directory parent scrub scans if we encounter a zapped directory

Christoph Hellwig
2023-12-04T04:41:10Z

On Thu, Nov 30, 2023 at 01:37:09PM -0800, Darrick J. Wong wrote:
> Hmm. A single "zapped" bit would be a good way to signal to
> xchk_dir_looks_zapped and xchk_bmap_want_check_rmaps that a file is
> probably broken. Clearing that bit would be harder though -- userspace
> would have to call back into the kernel after checking all the metadata.

Doesn't sound too horrible to have a special scrub call just for that.

> A simpler way might be to persist the entire per-inode sick state (both
> forks and the contents within, for three bits). That would be more to
> track, but each scrubber could clear its corresponding sick-state bit.
> A bit further on in this series is a big patchset to set the sick state
> every time the hot paths encounter an EFSCORRUPTED.

That does sound even better.

> IO operations could check the sick state bit and fail out to userspace,
> which would solve the problem of keeping programs away from a partially
> fixed file.
>
> The ondisk state tracking like an entire project on its own. Thoughts?

Incore for now sounds fine to me.