linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	Andy Whitcroft <apw@shadowen.org>
Subject: Re: [PATCH 02/35] Btrfs multi-device code
Date: Tue, 13 Jan 2009 12:58:45 -0500	[thread overview]
Message-ID: <1231869526.29164.142.camel@think.oraclecorp.com> (raw)
In-Reply-To: <20090113095255.bc8f94b2.akpm@linux-foundation.org>

On Tue, 2009-01-13 at 09:52 -0800, Andrew Morton wrote:
> On Tue, 13 Jan 2009 11:36:16 -0500 Chris Mason <chris.mason@oracle.com> wrote:
> 
> > > > +	bdev = open_bdev_exclusive(device_path, 0, root->fs_info->bdev_holder);
> > > > +	if (!bdev)
> > > > +		return -EIO;
> > > > +
> > > > +	if (root->fs_info->fs_devices->seeding) {
> > > > +		seeding_dev = 1;
> > > > +		down_write(&sb->s_umount);
> > > > +		mutex_lock(&uuid_mutex);
> > > > +	}
> > > > +
> > > > +	filemap_write_and_wait(bdev->bd_inode->i_mapping);
> > > 
> > > I'm surprised that this can be safely done under ->s_umount.
> > 
> > btrfs_init_new_device is only called by the add_dev ioctl.  That doesn't
> > happen with s_umount held.  Or do you mean we should be taking s_umount?
> 
> I'm surprised that filemap_write_and_wait() can safely be called under
> sb->s_umount.  But I guess filemap_write_and_wait() doesn't take many
> locks, even though it waits a lot.

In this case s_umount shouldn't be held.  But, aren't we running
something similar at umount time (entirely unrelated to this code path)?

At any rate, this flush is there to make sure that any mods made by
btrfs-vol -a /dev/xxx are actually on the device before the kernel tries
to add it.

-chris



  reply	other threads:[~2009-01-13 17:59 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08  3:56 [PATCH 00/35] Btrfs for review Chris Mason
2009-01-08  3:56 ` [PATCH 01/35] Btrfs xattr code Chris Mason
2009-01-13  4:59   ` Andrew Morton
2009-01-13 12:56     ` Josef Bacik
2009-01-13 14:37     ` Chris Mason
2009-01-08  3:56 ` [PATCH 02/35] Btrfs multi-device code Chris Mason
2009-01-13  6:23   ` Andrew Morton
2009-01-13 16:36     ` Chris Mason
2009-01-13 17:52       ` Andrew Morton
2009-01-13 17:58         ` Chris Mason [this message]
2009-01-30 15:09     ` Andy Whitcroft
2009-01-08  3:56 ` [PATCH 03/35] Btrfs tree logging (fsync optimizations) Chris Mason
2009-01-08  3:56 ` [PATCH 04/35] Btrfs transaction code Chris Mason
2009-01-08  3:56 ` [PATCH 05/35] Btrfs btree leaf reference cache Chris Mason
2009-01-08  3:56 ` [PATCH 06/35] Btrfs tree printk debugging Chris Mason
2009-01-08  3:56 ` [PATCH 07/35] Btrfs ordered data processing Chris Mason
2009-01-08  3:56 ` [PATCH 08/35] Btrfs btree locking helpers Chris Mason
2009-01-08  3:56 ` [PATCH 09/35] Btrfs zlib helpers Chris Mason
2009-01-08  3:57 ` [PATCH 10/35] Btrfs online btree defragging Chris Mason
2009-01-08  3:57 ` [PATCH 11/35] Btrfs sysfs routines Chris Mason
2009-01-08  3:57 ` [PATCH 12/35] Btrfs super operations Chris Mason
2009-01-08  3:57 ` [PATCH 13/35] Btrfs metadata access routines Chris Mason
2009-01-08  3:57 ` [PATCH 14/35] Btrfs tree of tree roots code Chris Mason
2009-01-08  3:57 ` [PATCH 15/35] Btrfs Orphan prevention Chris Mason
2009-01-08  3:57 ` [PATCH 16/35] Btrfs free inode allocation Chris Mason
2009-01-08  3:57 ` [PATCH 17/35] Btrfs inode item routines Chris Mason
2009-01-08  3:57 ` [PATCH 19/35] Btrfs directory name hashing Chris Mason
2009-01-08  3:57 ` [PATCH 20/35] Btrfs free space caching Chris Mason
2009-01-08  3:57 ` [PATCH 21/35] Btrfs file-item and checksumming routines Chris Mason
2009-01-08  3:57 ` [PATCH 22/35] Btrfs file write routines Chris Mason
2009-01-08  3:57 ` [PATCH 24/35] Btrfs directory item routines Chris Mason
2009-01-08  3:57 ` [PATCH 25/35] Btrfs main metadata header file Chris Mason
2009-01-08  3:57 ` [PATCH 27/35] Btrfs in-memory inode.h Chris Mason
2009-01-08  3:57 ` [PATCH 28/35] Btrfs acl implementation Chris Mason
2009-01-08  3:57 ` [PATCH 29/35] Btrfs ioctl code Chris Mason
2009-01-15 18:29   ` Ryusuke Konishi
2009-01-15 20:17     ` Linus Torvalds
2009-01-15 20:28       ` Chris Mason
2009-01-15 20:44         ` Linus Torvalds
2009-01-15 20:49           ` Chris Mason
2009-01-16 17:23       ` Chris Mason
2009-01-17  4:16         ` Ryusuke Konishi
2009-01-08  3:57 ` [PATCH 30/35] Btrfs extent_map: per-file extent lookup cache Chris Mason
2009-01-08  3:57 ` [PATCH 32/35] Btrfs NFS exporting routines Chris Mason
2009-01-08  3:57 ` [PATCH 33/35] Btrfs metadata disk-io routines Chris Mason
2009-01-08  3:57 ` [PATCH 34/35] Btrfs compression routines Chris Mason
2009-01-08  3:57 ` [PATCH 35/35] Async thread routines Chris Mason
2009-01-08 16:01 ` [PATCH 18.1/35] Btrfs inode operations Chris Mason
2009-01-08 16:04 ` [PATCH 18.2/35] Btrfs inode extent_io hooks Chris Mason
2009-01-08 16:06 ` [PATCH 23.1/35] Btrfs extent allocation code Chris Mason
2009-01-08 16:07 ` [PATCH 23.2/35] Btrfs snapshot deletion Chris Mason
2009-01-08 16:08 ` [PATCH 23.3/35] Btrfs extent relocation Chris Mason
2009-01-08 16:10 ` [PATCH 26.1/35] Btrfs btree core Chris Mason
2009-01-08 16:11 ` [PATCH 26.2/35] Btrfs btree item routines Chris Mason
2009-01-08 16:12 ` [PATCH 31.1/35] Btrfs extent io operations Chris Mason
2009-01-08 16:13 ` [PATCH 31.2/35] Btrfs extent_buffer code Chris Mason
2009-01-09  2:28 ` [PATCH 00/35] Btrfs for review Andi Kleen
2009-01-09 21:13   ` Chris Mason

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=1231869526.29164.142.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).