Re: [PATCH 1/2] nfsd: map the ELOOP to nfserr_symlink to avoid warning
From: NeilBrown
Date: Wed Feb 05 2025 - 20:09:53 EST
On Thu, 06 Feb 2025, Chuck Lever wrote:
>
> It's kind of interesting that there hasn't been a need to add an ELOOP
> mapping to nfserrno() until now. I'm a little hesitant to add a generic
> mapping without checking the thousand other places nfserrno() is called,
> but that might end up being a necessary part of this fix.
This ELOOP error is surprising on a local filesystem. It means that the
lookup of the given name found an inode for a directory which already
existed in the dcache as an ancestor of the directory being listed - or
possibly as the directory itself. For ext4, that means a corrupt
filesystem.
If the exported filesystem was NFS, then I think it is credible that a
complex race could result in this.
So we certainly need to handle ELOOP cleanly but we don't need to try
too hard to find a perfect solution. Returning nfserr_io would be
defensible. Nothing else really suits, certainly not NFS4ERR_SYMLINK
because there is no symlink involved here.
NeilBrown