On Wed, Oct 30, 2019 at 02:32:02PM -0700, Christoph Hellwig wrote: > On Tue, Oct 29, 2019 at 09:23:30AM -0700, Darrick J. Wong wrote: > > > So we'll at least need to document that for now. And maybe find a way > > > to not do the work twice eventually in a way that doesn't break repair. > > > > What if we promote EFSCORRUPTED and EFSBADCRC to the vfs (since 5 > > filesystems use them now); change the VFS check function to return that; > > and then we can just drop the xfs readdir calls to dir2_namecheck? Having looked more carefully at verify_dirent_name(), I now think XFS shouldn't drop the xfs_readdir calls to dir2_namecheck because the VFS namecheck function permits nulls in the middle of the name. Linus says the function does that intentionally because (in his opinion) userspace expects a null terminated string and won't care if namelen is longer than that. > EFSCORRUPTED should have moved to common code a long time ago, so that > is overdue. Not sure about EFSBADCRC, but that might not be a horrible > idea either. We might as well, since ext4 and XFS both standardized on both of those error codes. Hm, btrfs uses EUCLEAN and EIO for EFSCORRUPTED and EFSBADCRC, respectively. We probably ought to get them on board too. --D