mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Kent <ikent@redhat.com>
To: Michal Suchanek <hramrach@centrum.cz>
Cc: Peter Zijlstra <peterz@infradead.org>,
	David Howells <dhowells@redhat.com>,
	Ric Wheeler <rwheeler@redhat.com>,
	Alexander Viro <aviro@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jeff Moyer <jmoyer@redhat.com>,
	miklos@szeredi.hu
Subject: Re: Union mount and lockdep design issues
Date: Tue, 12 Jul 2011 01:23:53 +0800	[thread overview]
Message-ID: <1310405033.4276.28.camel@perseus.themaw.net> (raw)
In-Reply-To: <CAOMqctSDxauVLw5OisAeCaFa7DvZDgg_1YCmHaWdJZm60JDVtg@mail.gmail.com>

On Mon, 2011-07-11 at 18:17 +0200, Michal Suchanek wrote:
> On 11 July 2011 15:50, Ian Kent <ikent@redhat.com> wrote:
> > On Mon, 2011-07-11 at 15:36 +0200, Michal Suchanek wrote:
> >> On 11 July 2011 14:00, Peter Zijlstra <peterz@infradead.org> wrote:
> >> > On Mon, 2011-07-11 at 12:01 +0100, David Howells wrote:
> >> >> Peter Zijlstra <peterz@infradead.org> wrote:
> >> >>
> >>
> >> >> > Also, why would you want to have a class per sb-instance? From last
> >> >> > talking to David, he said there could only ever be 2 filesystems
> >> >> > involved in this, the top and bottom, and it is determined on (union)
> >> >> > mount time which is which.
> >> >>
> >> >> There can be more than 2 - one upperfs (the actual union) and many lowerfs -
> >> >> though I think only one lowerfs is accessed at a time.
> >> >
> >> > Right, however I understood from our earlier discussion that the vfs
> >> > would only ever try to lock 2 filesystems at a time, the top and one
> >> > lower.
> >>
> >> This is true from local point of view. However, it is technically
> >> possible to use overlayfs as the upper layer of another overlayfs
> >> which allows layering multiple readonly "branches" into a single
> >> overlay. Since the vfs will lock the "union" and one (or possibly
> >> both) of its branches and one of the branches may be itself an union
> >> you can get arbitrary depth (which is currently limited by a constant
> >> in the code to cut recursion depth and stack usage).
> >
> > Off topic but can you elaborate on that?
> >
> > Are you saying the "unioned stack" can consist of more than two file
> > systems and can have more than two layers and possibly a mix of multiple
> > read-only and read-write file systems?
> >
> 
> This is how requirements are described in documentation:
> 
> > The lower filesystem can be any filesystem supported by Linux and does
> > not need to be writable.  The lower filesystem can even be another
> > overlayfs.  The upper filesystem will normally be writable and if it
> > is it must support the creation of trusted.* extended attributes, and
> > must provide valid d_type in readdir responses, at least for symbolic
> > links - so NFS is not suitable.
> 
> In no place it says that the lower filesystem is required to be
> readonly, only that it should not be modified.
> 
> 
> This is what the documentation gives as example:
> 
> > mount -t overlayfs overlayfs -olowerdir=/lower,upperdir=/upper /overlay
> 
> This is how it can be expanded:
> 
> mount -t overlayfs overlayfs -olowerdir=/lower2,upperdir=/upper /tmpoverlay
> mount -t overlayfs overlayfs -olowerdir=/lower1,upperdir=/tmpoverlay /overlay

OK, I'll have to think about what this means but I suspect that it is
broken. I'll have a look at the overlayfs code and see if there are
globally enforced ordering of stacked file systems. If there is none
then I believe overlayfs is probably open to AB <-> BA deadlock due to
the possibility of locking two file systems in one overlayfs stack in
one order and the same two file systems in the opposite order in
another.

I don't remember seeing any unioning file system that checks and
enforces this type of global ordering, although I think the special case
checks of union mount pretty much cover it, AFAICT. Its been a while
since I looked at the code for any of the unioning file systems so I may
be wrong.

Assuming I am correct though, that then defines restrictions on what
should (or can) be aloud from a lockdep POV.

Ian



  reply	other threads:[~2011-07-11 17:24 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 15:00 Unionmount status? Michal Suchanek
2011-04-12 20:31 ` Ric Wheeler
2011-04-12 21:36   ` Michal Suchanek
2011-04-13 14:18     ` Jiri Kosina
2011-04-13 15:13       ` Michal Suchanek
2011-04-14  8:38         ` Miklos Szeredi
2011-04-14  9:48           ` Sedat Dilek
2011-04-14  9:58             ` Miklos Szeredi
2011-04-15 11:22           ` Michal Suchanek
2011-04-15 11:31             ` Miklos Szeredi
2011-04-15 11:51               ` Michal Suchanek
2011-04-15 12:29                 ` Miklos Szeredi
2011-04-15 12:34                   ` Michal Suchanek
2011-04-15 12:48                     ` Miklos Szeredi
2011-04-15 21:48                   ` Hugh Dickins
2011-04-15 22:18                   ` Andreas Dilger
2011-04-18 13:31                     ` Michal Suchanek
2011-04-19 20:04                       ` [PATCH] tmpfs: implement generic xattr support Miklos Szeredi
2011-04-20  2:18                         ` Phillip Lougher
2011-04-20 13:43                           ` Miklos Szeredi
2011-04-21  6:59                             ` Michal Suchanek
2011-04-21  9:08                               ` Miklos Szeredi
2011-04-21 10:59                                 ` Michal Suchanek
2011-04-21 14:58                                   ` Jordi Pujol
2011-04-21 15:22                                     ` Michal Suchanek
2011-04-21 15:43                                       ` Michal Suchanek
2011-04-21 17:26                                         ` Miklos Szeredi
2011-04-21 19:17                                           ` Michal Suchanek
2011-04-20 16:00                         ` Serge E. Hallyn
2011-05-12  4:20                         ` Hugh Dickins
2011-05-12  7:52                           ` Michal Suchanek
2011-05-12 12:27                           ` Miklos Szeredi
2011-05-12 14:00                             ` Miklos Szeredi
2011-05-12 16:52                               ` Hugh Dickins
2011-04-18 13:34                     ` Unionmount status? Michal Suchanek
2011-04-18 13:37                     ` Michal Suchanek
2011-04-13 17:26     ` Ric Wheeler
2011-04-13 18:58       ` Michal Suchanek
2011-04-13 19:11         ` Ric Wheeler
2011-04-13 19:47           ` Michal Suchanek
2011-04-14  4:50             ` Ian Kent
2011-04-14  9:32               ` Michal Suchanek
2011-04-14  9:40                 ` Miklos Szeredi
2011-04-14 13:21                   ` Ric Wheeler
2011-04-14 14:54                     ` Michal Suchanek
2011-04-15 16:31                       ` Ric Wheeler
2011-04-14 19:14             ` David Howells
2011-06-29  9:39               ` Union mount and overlayfs bake off? Ric Wheeler
2011-06-29 11:40                 ` Michal Suchanek
2011-06-29 10:17               ` David Howells
2011-06-30 12:44                 ` Miklos Szeredi
2011-07-10  8:28                 ` Union mount and lockdep design issues Ric Wheeler
2011-07-10 13:48                   ` Peter Zijlstra
2011-07-11  8:35                     ` Michal Suchanek
2011-07-11 11:01                   ` David Howells
2011-07-11 12:00                     ` Peter Zijlstra
2011-07-11 13:36                       ` Michal Suchanek
2011-07-11 13:50                         ` Ian Kent
2011-07-11 16:17                           ` Michal Suchanek
2011-07-11 17:23                             ` Ian Kent [this message]
2011-07-11 18:08                               ` Michal Suchanek
2011-07-12  8:30                                 ` Miklos Szeredi
2011-07-12  9:58                                   ` Michal Suchanek
2011-07-12 11:45                                     ` Miklos Szeredi
2011-07-12 18:49                                       ` Michal Suchanek
2011-07-13  9:49                                         ` Miklos Szeredi
2011-07-13 12:02                                 ` David Howells
2011-07-13 13:20                                   ` Miklos Szeredi
2011-07-14  0:57                                   ` David Howells
2011-07-11 13:54                     ` David Howells
2011-07-11 14:02                       ` Peter Zijlstra
2011-07-11 14:50                         ` [PATCH 1/2] VFS: Pass mount flags to sget() David Howells
2011-07-11 14:50                         ` [PATCH 2/2] union-mount: Duplicate the i_{, dir_}mutex lock classes and use for upper layer David Howells

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=1310405033.4276.28.camel@perseus.themaw.net \
    --to=ikent@redhat.com \
    --cc=aviro@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=hramrach@centrum.cz \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rwheeler@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome