On Tue, Oct 22, 2024 at 6:04 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote: > > On Tue, 22 Oct 2024 at 17:56, Miklos Szeredi <mszeredi@xxxxxxxxxx> wrote: > > > > Add a comment explaining the reason for the seemingly pointless extra > > reference. > > > > Suggested-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> > > Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx> > > --- > > fs/overlayfs/dir.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c > > index ab65e98a1def..9e97f7dffd90 100644 > > --- a/fs/overlayfs/dir.c > > +++ b/fs/overlayfs/dir.c > > @@ -28,6 +28,10 @@ int ovl_cleanup(struct ovl_fs *ofs, struct inode *wdir, struct dentry *wdentry) > > { > > int err; > > > > + /* > > + * Cached negative upper dentries are generally not useful, so grab a > > + * ref to the victim to keep it from turning negative. > > + */ > > In fact an explicit d_drop() after the fact would have exactly the > same effect, so maybe that would be cleaner... > Agree. Thanks, Amir.