linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dave@jikos.cz>
To: kreijack@inwind.it
Cc: David Sterba <dsterba@suse.cz>,
	linux-btrfs@vger.kernel.org, chris.mason@oracle.com
Subject: Re: [PATCH] btrfs: do not allow mounting non-subvolumes via subvol option
Date: Wed, 3 Aug 2011 20:12:59 +0200	[thread overview]
Message-ID: <20110803181259.GC28122@twin.jikos.cz> (raw)
In-Reply-To: <4E32E9C0.9000804@libero.it>

On Fri, Jul 29, 2011 at 07:11:28PM +0200, Goffredo Baroncelli wrote:
> >$ btrfs subvol list -p .
> >ID 258 parent 5 top level 5 path subvol
> >ID 259 parent 5 top level 5 path subvol1
> >ID 260 parent 5 top level 5 path default-subvol1
> >ID 262 parent 5 top level 5 path p1/p1-snapshot
> >ID 263 parent 259 top level 5 path subvol1/subvol1-snap
> >
> >The problem I see is that this makes a false impression of snapshotting the
> >given subvolume but in fact snapshots the default one: a user expects outcome
> 
> Not that matter too much, but the old behavior was to snapshot not
> the "default one" but the one which contains the directory.
> This behavior leaded to a lot of misunderstanding about the btrfs
> capability of snapshot subvolume __only__.
> 
> Only one question, what happens now if an user pass subvol=<dir> ?

$ mount /dev/sda5 /mnt/sda5
$ cd sda5
$ mkdir p
$ cd ..
$ umount sda5
$ mount -o subvol=p /dev/sda5 /mnt/sda5
mount: wrong fs type, bad option, bad superblock on /dev/sda5,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

and dmesg says:
[ 7285.905195] device fsid 46e97521-a1c7-4509-954f-b32c90bd1d1e devid 1 transid 10 /dev/sdb5
[ 7285.954435] btrfs: disk space caching is enabled
[ 7286.600155] btrfs: 'p' is not a valid subvolume

There could be a specific error code like ENSUBVOL and mount could be
taught to give better description of what has happened. Otherwise, I took
the approach of being verbose in dmesg.


HTH,
david

      reply	other threads:[~2011-08-03 18:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 10:14 [PATCH] btrfs: do not allow mounting non-subvolumes via subvol option David Sterba
2011-07-29 16:16 ` Zhong, Xin
2011-08-03 18:47   ` David Sterba
2011-08-03 19:08     ` C Anthony Risinger
2011-07-29 17:11 ` Goffredo Baroncelli
2011-08-03 18:12   ` David Sterba [this message]

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=20110803181259.GC28122@twin.jikos.cz \
    --to=dave@jikos.cz \
    --cc=chris.mason@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).