On Wed, 28 Jul 2021, Christian Brauner wrote: > > Hey Neil, > > Sorry if this is a stupid question but wouldn't you want to copy the > mount properties from path->mnt here? Couldn't you otherwise use this to > e.g. suddenly expose a dentry on a read-only mount as read-write? There are no stupid questions, and this is a particularly non-stupid one! I hadn't considered that, but having examined the code I see that it is already handled. The vfsmount that d_automount returns is passed to finish_automount(), which hands it to do_add_mount() together with the mnt_flags for the parent vfsmount (plus MNT_SHRINKABLE). do_add_mount() sets up the mnt_flags of the new vfsmount. In fact, the d_automount interface has no control of these flags at all. Whatever it sets will be over-written by do_add_mount. Thanks, NeilBrown