Re: [PATCH 19/18] Unexport do_add_mount() and add in follow_automount(), not ->d_automount()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux