Re: [PATCH 13/19] vfs: Add a mount-notification facility [ver #16]

From: Jann Horn
Date: Wed Feb 19 2020 - 17:55:57 EST


On Wed, Feb 19, 2020 at 11:40 PM Jann Horn <jannh@xxxxxxxxxx> wrote:
> On Tue, Feb 18, 2020 at 6:07 PM David Howells <dhowells@xxxxxxxxxx> wrote:
[...]
> > + watch = NULL;
> > + }
> > + up_write(&m->mnt.mnt_sb->s_umount);
> > + } else {
> > + ret = -EBADSLT;
> > + if (m->mnt_watchers) {
> > + down_write(&m->mnt.mnt_sb->s_umount);
> > + ret = remove_watch_from_object(m->mnt_watchers, wqueue,
> > + (unsigned long)path.dentry,
> > + false);
>
> What exactly is the implication of only using the dentry as key here
> (and not the mount)? Does this mean that if you watch install watches
> on two bind mounts of the same underlying filesystem, the notification
> mechanism gets confused?

Ah, nevermind, I understand this one now... this operation only
removes watches on this mount with that dentry, and so together, that
means it effectively removes watches by the full path.