linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* crash when mounting subvolume in a subdirectory
@ 2010-12-06 22:27 Michael Niederle
  2010-12-07  1:40 ` Li Zefan
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Niederle @ 2010-12-06 22:27 UTC (permalink / raw)
  To: linux-btrfs

Hi!

I'm not sure whether this *should* be possible, but I think it *shouldn't*
crash:

I created a snapshot of the root directory within a subdirectory:

# mount /dev/sde2 /mnt
# cd /mnt
# mkdir save
# btrfs subvolume snapshot . save/snap1
# umount /mnt

Then I tried to mount the snapshot:

# mount -o subvol=save/snap1 /dev/sde2 /mnt

This inevitably leads to a segfault in the btrfs-driver crashing the whole
system. I tried this with kernel versions 2.6.32 and 2.6.37.rc4.

If I create the subvolume within the root directory of the btrfs volume
everything works fine.

I'm using btrfs for nearly a year by now (since the release of 2.6.32) and am
using subvolumes within subdirectories since then but never tried to directly
mount one until today, when my main btrfs volume crashed (by a hardware failure
or due to a bug in 2.6.36 - I don't know).

If you cannot reproduce this behaviour I can try to send you the kernel log
(not so easy, because the system crashes and I will have to write it down by
hand).

Greetings, Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: crash when mounting subvolume in a subdirectory
  2010-12-06 22:27 crash when mounting subvolume in a subdirectory Michael Niederle
@ 2010-12-07  1:40 ` Li Zefan
  2010-12-07  1:44   ` C Anthony Risinger
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zefan @ 2010-12-07  1:40 UTC (permalink / raw)
  To: Michael Niederle; +Cc: linux-btrfs

Michael Niederle wrote:
> Hi!
> 
> I'm not sure whether this *should* be possible, but I think it *shouldn't*
> crash:
> 
> I created a snapshot of the root directory within a subdirectory:
> 
> # mount /dev/sde2 /mnt
> # cd /mnt
> # mkdir save
> # btrfs subvolume snapshot . save/snap1
> # umount /mnt
> 
> Then I tried to mount the snapshot:
> 
> # mount -o subvol=save/snap1 /dev/sde2 /mnt
> 
> This inevitably leads to a segfault in the btrfs-driver crashing the whole
> system. I tried this with kernel versions 2.6.32 and 2.6.37.rc4.
> 
> If I create the subvolume within the root directory of the btrfs volume
> everything works fine.
> 
> I'm using btrfs for nearly a year by now (since the release of 2.6.32) and am
> using subvolumes within subdirectories since then but never tried to directly
> mount one until today, when my main btrfs volume crashed (by a hardware failure
> or due to a bug in 2.6.36 - I don't know).
> 
> If you cannot reproduce this behaviour I can try to send you the kernel log
> (not so easy, because the system crashes and I will have to write it down by
> hand).

It's currently not allowed to mount a subvolume which is not created in
the root directory of the default subvolume, so you should have failed
to mount, but you hit a bug..

I've fixed it, and will send out the patch in minutes.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: crash when mounting subvolume in a subdirectory
  2010-12-07  1:40 ` Li Zefan
@ 2010-12-07  1:44   ` C Anthony Risinger
  0 siblings, 0 replies; 3+ messages in thread
From: C Anthony Risinger @ 2010-12-07  1:44 UTC (permalink / raw)
  To: Li Zefan; +Cc: Michael Niederle, linux-btrfs

On Mon, Dec 6, 2010 at 7:40 PM, Li Zefan <lizf@cn.fujitsu.com> wrote:
> Michael Niederle wrote:
>> Hi!
>>
>> I'm not sure whether this *should* be possible, but I think it *shouldn't*
>> crash:
>
> It's currently not allowed to mount a subvolume which is not created in
> the root directory of the default subvolume, so you should have failed
> to mount, but you hit a bug..
>
> I've fixed it, and will send out the patch in minutes.

i did the same thing, except for a slightly different reason and
slightly more accidentally on purpose:

http://www.spinics.net/lists/linux-btrfs/msg07190.html

buuuuut, i ended up with a corrupted FS (that i still have a dump of,
happily waiting for a way to mount it... *hint* :-) so if your are
still up and running then luck is on your side, and don't do it again
;-)

C Anthony

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-07  1:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-06 22:27 crash when mounting subvolume in a subdirectory Michael Niederle
2010-12-07  1:40 ` Li Zefan
2010-12-07  1:44   ` C Anthony Risinger

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).