From: James Shubin <purpleidea@redhat.com>
To: kreijack@inwind.it
Cc: Eric Sandeen <sandeen@redhat.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>,
jshubin@redhat.com
Subject: Re: [PATCH] mkfs.btrfs: allow UUID specification at mkfs time
Date: Wed, 14 May 2014 10:47:29 -0400 [thread overview]
Message-ID: <1400078849.15603.177.camel@rh> (raw)
In-Reply-To: <5373803E.9000406@libero.it>
[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]
On Wed, 2014-05-14 at 16:39 +0200, Goffredo Baroncelli wrote:
> Hi Eric,
>
> On 05/14/2014 03:18 AM, Eric Sandeen wrote:
> > Allow the specification of the filesystem UUID at mkfs time.
>
> I suggest to add some warning when this options is used, because the behavior could be very different than the one expected.
>
> I suspect that BTRFS tracks the filesystem by UUID and not by devices. When two filesystems have the same UUID at the same time, it may mount the wrong one.
>
> $ #
> $ # Make two *different* filesystems with the *same* UUID
> $ #
> $ UUID=e285c9bd-ea97-40b3-ad7d-8713dcfd5eea
> $ sudo ./mkfs.btrfs -f -U $UUID /dev/vdg
> $ sudo ./mkfs.btrfs -f -U $UUID /dev/vdh
>
> $ #
> $ # from the beginning "btrfs fi show" reports wrong information
> $ #
> $ sudo btrfs fi show
> Label: none uuid: e285c9bd-ea97-40b3-ad7d-8713dcfd5eea
> Total devices 1 FS bytes used 96.00KB
> devid 1 size 50.00GB used 4.00MB path /dev/vdh
> devid 1 size 50.00GB used 2.04GB path /dev/vdg
>
> $ #
> $ # mount the first one, create a new file then un-mount it
> $ #
> $ sudo mount /dev/vdg /mnt/btrfs1
> $ sudo touch /mnt/btrfs1/dev-vdg
> $ sudo umount /dev/vdg
>
> $ #
> $ # mount the second one, it should be empty
> $ # instead btrfs mount the first one
> $ #
> $ sudo mount /dev/vdh /mnt/btrfs2
> $ ls -l /mnt/btrfs2
> total 0
> -rw-r--r-- 1 root root 0 May 14 16:12 dev-vdg
>
>
> I am not against this option; I am suggesting to add a explicit warning to the user about the risk of doing that, both on the man pages and into the program.
> The warning should say that this option is only for testing. Better ask for a confirmation (even with an undocumented switch like '--I-know-that-I-am-doing-something-really-dangerous').
I don't think is necessary since xfs and ext4 both have these options
too... There probably *should* be a conflict, because typically this
will cause an entry to show up in
/dev/disks/by-uuid/$UUID
I'm sure this same bug exists if two "randomly generated UUID's" get
created too. I think a warning in the man page would be enough.
>
> For the record, BTRFS seems unable to mount at the same time two different filesystems with the same UUID:
>
> $ #
> $ # try to mount two fs with the same UUID, but BTRFS doesn't allow it
> $ #
> $ sudo mount /dev/vdh /mnt/btrfs2
> $ sudo mount /dev/vdg /mnt/btrfs1
> ERROR: mount failed : 16 - Device or resource busy
>
>
> BR
> G.Baroncelli
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-14 14:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 1:18 [PATCH] mkfs.btrfs: allow UUID specification at mkfs time Eric Sandeen
2014-05-14 7:31 ` Wang Shilong
2014-05-14 12:25 ` Brendan Hide
2014-05-14 13:34 ` Duncan
2014-05-14 14:42 ` James Shubin
2014-05-14 13:28 ` Eric Sandeen
2014-05-14 13:34 ` David Pottage
2014-05-14 14:39 ` Goffredo Baroncelli
2014-05-14 14:41 ` Eric Sandeen
2014-05-14 15:14 ` Goffredo Baroncelli
2014-05-14 15:27 ` David Sterba
2014-05-14 14:47 ` James Shubin [this message]
2014-05-14 15:35 ` [PATCH V2] " Eric Sandeen
2014-05-14 16:01 ` David Sterba
2014-05-14 16:09 ` Eric Sandeen
2014-05-14 16:52 ` Goffredo Baroncelli
2014-05-14 17:39 ` PATCH V3] " Eric Sandeen
2014-05-14 22:04 ` Goffredo Baroncelli
2014-05-14 22:07 ` Eric Sandeen
2014-05-15 17:39 ` David Sterba
2014-05-15 17:53 ` Eric Sandeen
2014-05-16 17:24 ` 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=1400078849.15603.177.camel@rh \
--to=purpleidea@redhat.com \
--cc=jshubin@redhat.com \
--cc=kreijack@inwind.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=sandeen@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.