On Fri, Jan 14, 2011 at 05:56:48PM +0000, Al Viro wrote: > BTW, speaking of mntput_long(): I really hate that API. It's > asking for subtle leaks - use mntget_long() in pair with mntput() and > you are fucked. Worse, these suckers are created with long reference > now, so any code that used to use mntput() to kill a cloned/freshly > created vfsmount got silently b0rken. A quick look already caught > one such case - fs/nfsctl.c do_open() uses mntput() in pair with > do_kern_mount(), which leads to longrefs left at 1. > > Rationale for that mess, please... FWIW, what I intend to do is to keep these longrefs _only_ for cwd/root/attached or possibly hashed and set them alongside the normal ref. I.e. require the callers of mntput_long() (not exported, local to core VFS) to keep the normal reference. That way it would turn into hint for mntput() - "we have persistent refs, just decrement count on this CPU and piss off", with mntput_long() never going into the whole "and now we are dropping the last ref" part. AFAICS, it keeps your write-free objectives and gets much saner API. Shout if you have problems with that... -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html