From: Josef Bacik <josef@redhat.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: Josef Bacik <josef@redhat.com>,
linux-btrfs@vger.kernel.org, chris.mason@fusionio.com
Subject: Re: [PATCH 2/2] Btrfs: implement ->show_devname
Date: Tue, 12 Jun 2012 09:23:08 -0400 [thread overview]
Message-ID: <20120612132307.GA1565@localhost.localdomain> (raw)
In-Reply-To: <4FD6F0B5.3000703@cn.fujitsu.com>
On Tue, Jun 12, 2012 at 03:33:09PM +0800, Miao Xie wrote:
> On tue, 5 Jun 2012 14:16:33 -0400, Josef Bacik wrote:
> > Because btrfs can remove the device that was mounted we need to have a
> > ->show_devname so that in this case we can print out some other device in
> > the file system to /proc/mount. We keep track of what device we called
> > mount() with so that we can print out the correct one if it is still
> > available, but otherwise we just pick the first device that has the lowest
> > device id. This was inspired (and copied in the case of btrfs_show_devname)
> > from Miao Xie's patch. Thanks,
>
> In fact, it is hard to keep track of the device that was mounted although we
> add a flag to mark it unless we pass ->mnt_devname into ->show_devname(). For
> example:
> # mkfs.btrfs <disk1> <disk2>
> # mount <disk1> <mnt1>
> # mount <disk2> <mnt2>
> # cat /proc/mounts
> <disk2> <mnt1> ...
> <disk2> <mnt2> ...
>
> The mounted device of the first mount operation was changed.
>
> Maybe we are overnice, and we needn't keep track of that device, and just
> print out the name of the device which has the lowest device id.
>
Hah oops didn't think of that. I think you are right, doing the lowest dev id
is probably the most consistent thing to do, what do you think Chris? Thanks,
Josef
next prev parent reply other threads:[~2012-06-12 13:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 18:16 [PATCH 1/2] Btrfs: use rcu to protect device->name Josef Bacik
2012-06-05 18:16 ` [PATCH 2/2] Btrfs: implement ->show_devname Josef Bacik
2012-06-12 7:33 ` Miao Xie
2012-06-12 13:23 ` Josef Bacik [this message]
2012-06-11 13:23 ` [PATCH 1/2] Btrfs: use rcu to protect device->name David Sterba
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=20120612132307.GA1565@localhost.localdomain \
--to=josef@redhat.com \
--cc=chris.mason@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).