Re: [PATCH] ovl: skip stale entries in impure dir iteration

From: Amir Goldstein

Date: Wed Nov 11 2026 - 07:52:40 EST


On Wed, Nov 11, 2026 at 5:50 AM Daejun Park <daejun7.park@xxxxxxxxxxx> wrote:
>
> Your mail below did not reach my mailbox, so I could not reply to it
> directly.
>
> https://lore.kernel.org/all/CAOQ4uxgxYZqE=rv5ZYrbyB0cYi_qS-bv_4UCbDwGJoMGg1iNhQ@xxxxxxxxxxxxxx/
>
> On Tue, Nov 10, 2026 at 04:28:32PM +0100, Amir Goldstein wrote:
> > I am sorry, but this is way too complex to deal with a problem which
> > is not important enough IMO.
> >
> > POSIX does not define the exact behavior of readdir of a directory
> > being changed in this way and I don't think that the current behavior
> > of ext or overlayfs+ext4 is a gross violation of POSIX or that it could
> > break applications.
> >
> > I would be happy to be proven otherwise.
>
> Thanks for the review. I'll drop this patch.
>
> I looked for a program that breaks on the stale d_ino and did not find
> one. Of the d_ino users I read (find -inum, gnulib fts, glibc getcwd(),
> nfsd READDIRPLUS), none does anything wrong with an entry whose file
> is already gone.

Hi Daejun,

I think your patch triggered Sashiko to look at existing code and it
found this issue
which is a long lasting d_ino/st_ino inconsistency:

https://sashiko.dev/#/bug/linux-98f207b6-3936-48e9-a40f-88f20be4db7b

Would you like to fix it and send a test for this case?

Thanks,
Amir.