On Thu, Apr 24, 2025 at 07:08:45AM +0100, Al Viro wrote: > Currently the calling conventions for ->d_automount() instances have > an odd wart - returned new mount to be attached is expected to have > refcount 2. > > That kludge is intended to make sure that mark_mounts_for_expiry() called > before we get around to attaching that new mount to the tree won't decide > to take it out. finish_automount() drops the extra reference after it's > done with attaching mount to the tree - or drops the reference twice in > case of error. ->d_automount() instances have rather counterintuitive > boilerplate in them. > > There's a much simpler approach: have mark_mounts_for_expiry() skip the > mounts that are yet to be mounted. And to hell with grabbing/dropping > those extra references. Makes for simpler correctness analysis, at that... > > Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> > --- Looks good! Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>