From: Jan Blunck <jblunck@suse.de>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/4] Union mount documentation.
Date: Wed, 20 Jun 2007 12:56:58 +0000 (UTC) [thread overview]
Message-ID: <f5b86q$f4g$2@sea.gmane.org> (raw)
In-Reply-To: 1182319191.2700.9.camel@laptopd505.fenrus.org
On Tue, 19 Jun 2007 22:59:51 -0700, Arjan van de Ven wrote:
> user does on FS A:
> mkdir /mnt/A/somedir
> touch /mnt/A/somedir/somefile
>
> and then 2 things happen in parallel
> 1) touch /mnt/B/somefile
> 2) mv /mnt/union/somedir /mnt/union/somefile
>
> since the underlying FS for 2) is FS A... how will this work out locking
> wise? Will the VS lock the union directory only? Or will this operate
> only on the underlying FS? How is dcache consistency guaranteed for
> scenarios like this?
Ok, with Christophs help I guess I know now what the question is :)
touch /mnt/B/somefile is doing a lookup in "B" for "somefile". Therefore it
locks B->i_mutex for that. When it gets a negative dentry it creates the
file.
mv /mnt/union/somedir /mnt/union/somefile is doing a lookup in "union" for
"somefile". Therefore it first locks the i_mutex of the topmost directory
in the union of "/mnt/union" (which happens to be "B"). When it gets a
negative dentry it than follows the union down to the next layer (with the
topmost directory still locked). Lookup is repeated until a filled dentry
is found or the topmost dentry negative dentry is used as a target for the
move. Thats it.
Did that answer your question?
Cheers,
Jan
next prev parent reply other threads:[~2007-06-20 13:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-20 5:50 [RFC PATCH 0/4] New approach to VFS based union mount Bharata B Rao
2007-06-20 5:51 ` [RFC PATCH 1/4] Union mount documentation Bharata B Rao
2007-06-20 5:59 ` Arjan van de Ven
2007-06-20 7:29 ` Jan Blunck
2007-06-20 12:32 ` Christoph Hellwig
2007-06-20 12:43 ` Jan Blunck
2007-06-20 13:25 ` Christoph Hellwig
2007-06-20 17:28 ` Erez Zadok
2007-06-21 5:25 ` Bharata B Rao
2007-06-21 16:29 ` Josef Sipek
2007-06-21 16:39 ` Erez Zadok
2007-06-20 12:56 ` Jan Blunck [this message]
2007-06-20 8:11 ` Jan Blunck
2007-06-20 9:09 ` Bharata B Rao
2007-06-20 5:52 ` [RFC PATCH 2/4] Mount changes to support union mount Bharata B Rao
2007-06-20 7:47 ` Jan Blunck
2007-06-20 8:53 ` Bharata B Rao
2007-06-21 16:40 ` Josef Sipek
2007-06-20 5:53 ` [RFC PATCH 3/4] Lookup " Bharata B Rao
2007-06-20 7:51 ` Jan Blunck
2007-06-20 8:56 ` Bharata B Rao
2007-06-20 5:54 ` [RFC PATCH 4/4] Directory listing support for union mounted directories Bharata B Rao
2007-06-20 12:09 ` Christoph Hellwig
2007-06-20 14:22 ` Trond Myklebust
2007-06-20 17:02 ` Christoph Hellwig
2007-06-20 17:44 ` Trond Myklebust
2007-06-30 9:43 ` Christoph Hellwig
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='f5b86q$f4g$2@sea.gmane.org' \
--to=jblunck@suse.de \
--cc=linux-kernel@vger.kernel.org \
/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