Re: [PATCH 4/4] xfs: repair file modes by scanning for a dirent pointing to us

Christoph Hellwig
2024-01-02T10:29:42Z

On Sun, Dec 31, 2023 at 12:07:18PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> An earlier version of this patch ("xfs: repair obviously broken inode
> modes") tried to reset the di_mode of a file by guessing it from the
> data fork format and/or data block 0 contents. Christoph didn't like
> this approach because it opens the possibility that users could craft a
> file to look like a directory and trick online repair into turning the
> mode into S_IFDIR.

I find the commit message here really weird. What I want doesn't
matter. If what I say makes sense (I hope it does, if it doesn't please
push back) then we should document thing based on the cross-checked
facts and assumptions I provided. If not we should not be doing this
at at all.