LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ram Pai <linuxram@us.ibm.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Trond.Myklebust@netapp.com,
	dhowells@redhat.com
Subject: Re: [patch 3/6] vfs: mountinfo stable peer group id
Date: Sun, 30 Mar 2008 12:33:41 -0700	[thread overview]
Message-ID: <1206905621.3694.28.camel@ram.us.ibm.com> (raw)
In-Reply-To: <20080322041131.GA10722@ZenIV.linux.org.uk>

On Sat, 2008-03-22 at 04:11 +0000, Al Viro wrote:
> On Sat, Mar 22, 2008 at 03:49:50AM +0000, Al Viro wrote:
> 
> >       Shifting increment from mnt_set_mountpoint() and commit_tree()
> > to theirs callers and collapsing where possible, we get the
> following:
> >       * decrement in release_mounts() when resetting ->mnt_parent
> >       * increment in propagate_mnt() after call of
> mnt_set_mountpoint()
> >       * decrement in attach_recursive_mnt() in the loop calling
> > commit_tree() for clones (on mountpoint of each clone).
> >       * increment in umount_tree() at the point where we update
> d_mounted.
> 
> ... except that it'd give a leak in case of mount to shared mountpoint
> failing halfway through - we'll get double increments since
> umount_tree()
> would hit the mountpoints of cloned trees with extra increment, even
> though 
> reference from root of cloned to its mountpoint is _already_ a ghost.

> OTOH, we probably don't want to bother with counting those anyway -
> i.e.
> it's simply a bad definition and the right one would be along the
> lines of
> "number of vfsmounts that are doomed to be eaten by release_mounts()
> and
> that have ->mnt_parent pointing to us".  IOW, dropping the 2nd and 3rd
> in the above would do the right thing - anything chewed by
> umount_tree()
> *will* go to release_mounts() and ones in flight are what we are
> interested
> in... 

By not accounting for the ghost reference created in propagate_mnt(),
i.e case 2 and 3; the race is still on with shrink_mounts. But I think,
you are right. We don't want the shrink_mounts and friends to think that
the mounts are available to be purged, by accounting them into
mnt_ghosts.

RP





  parent reply	other threads:[~2008-03-30 19:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 21:26 [patch 0/6] vfs: mountinfo update Miklos Szeredi
2008-03-13 21:26 ` [patch 1/6] vfs: mountinfo -mm fix Miklos Szeredi
2008-03-13 21:26 ` [patch 2/6] vfs: pnode cleanup Miklos Szeredi
2008-03-19 11:16   ` Al Viro
2008-03-19 11:48     ` Miklos Szeredi
2008-03-13 21:26 ` [patch 3/6] vfs: mountinfo stable peer group id Miklos Szeredi
2008-03-19 11:48   ` Al Viro
2008-03-19 16:41     ` Miklos Szeredi
2008-03-19 18:20       ` Al Viro
2008-03-19 18:37         ` Miklos Szeredi
2008-03-20 21:43           ` Al Viro
2008-03-21  8:57             ` Miklos Szeredi
2008-03-22  3:49             ` Al Viro
2008-03-22  3:54               ` Al Viro
2008-03-22  4:11               ` Al Viro
2008-03-22  4:56                 ` Al Viro
2008-03-30 19:33                 ` Ram Pai [this message]
2008-03-24  8:50             ` Ram Pai
2008-03-24  8:54               ` Christoph Hellwig
2008-03-24  9:53               ` Al Viro
2008-03-22 16:27           ` Al Viro
2008-03-24  8:19             ` Ram Pai
2008-03-24  9:34               ` Al Viro
2008-03-13 21:26 ` [patch 4/6] vfs: mountinfo show dominating " Miklos Szeredi
2008-03-19 11:37   ` Al Viro
2008-03-19 12:03     ` Miklos Szeredi
2008-03-19 12:19       ` Miklos Szeredi
2008-03-19 12:41         ` Al Viro
2008-03-19 13:07           ` Miklos Szeredi
2008-03-13 21:26 ` [patch 5/6] vfs: optimization to /proc/<pid>/mountinfo patch Miklos Szeredi
2008-03-19 11:56   ` Al Viro
2008-03-19 16:56     ` Miklos Szeredi
2008-03-13 21:26 ` [patch 6/6] vfs: mountinfo: only show mounts under tasks root Miklos Szeredi
2008-03-19 12:12   ` Al Viro
2008-03-19 12:25     ` Miklos Szeredi
2008-03-13 22:53 ` [patch 0/6] vfs: mountinfo update Andrew Morton
2008-03-14  8:17   ` Miklos Szeredi
2008-03-14 19:29     ` Ram Pai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206905621.3694.28.camel@ram.us.ibm.com \
    --to=linuxram@us.ibm.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@ZenIV.linux.org.uk \
    --subject='Re: [patch 3/6] vfs: mountinfo stable peer group id' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).