Re: Possible Kernel BUG regarding BTRFS

2011-01-20 Thread Hugo Mills
(cc: btrfs list added)

On Thu, Jan 20, 2011 at 12:09:13AM -0800, Sorin wrote:
 Hardware:
 Intel Core i7, 8 GB RAM, SATA3 HDD with 3 partitions: EXT4 (/boot),
 BTRFS (/) with encrypted home folder, SWAP
 
 OS:
 Ubuntu 10.10 Desktop 64bit, with Kernel 2.6.35-24-generic

   I would suggest trying again with 2.6.37. If you can't build it
yourself, there's a PPA at
https://launchpad.net/~kernel-ppa/+archive/ppa with recent kernels in
it.

   Hugo.

 Computer screen froze and after I rebooted I got the following error
 message: no init found. try passing init= bootarg
 I booted from Ubuntu CD and when I tried to mount the BTRFS partition,
 computer froze again.
 I disconnected the hard drive and added it to another computer (same
 hardware configuration, same Ubuntu/kernel) as a second hard drive. I
 booted this second computer from it's original hard drive and when I
 tried to mount the BTRFS partition from the second hard drive,
 computer froze again.
 I tried different utilities to test the BTRFS partition and the hard
 drive for errors and it seems that everything is fine, except I cannot
 mount it, without having the computer freeze. I tried the following
 commands: sudo btrfsck /dev/sda2, sudo gparted.
 
 In order to collect some logs, I added the hard drive to the second
 computer (as a secondary hard drive), and below you can see all the
 logs from the moment I clicked on the BTRFS partition in Nautilus, in
 order to mount it. Computer froze instantly. See the logs below:
 
 /var/log/syslog
 Jan 19 20:05:00 Desktop kernel: [ 2091.228274] device fsid
 b849836048fddcda-fdb584bb7dae7bb1 devid 1 transid 97123 /dev/sdb2
 Jan 19 20:05:00 Desktop kernel: [ 2091.228294] BUG: unable to handle
 kernel NULL pointer dereference at 0128
 Jan 19 20:05:00 Desktop kernel: [ 2091.228298] IP: []
 btrfs_test_super+0x10/0x30 [btrfs]
 Jan 19 20:05:00 Desktop kernel: [ 2091.228309] PGD 2338f8067 PUD 235875067 
 PMD 0
 Jan 19 20:05:00 Desktop kernel: [ 2091.228313] Oops:  [#2] SMP
 Jan 19 20:05:00 Desktop kernel: [ 2091.228316] last sysfs file:
 /sys/devices/pci:00/:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda2/uevent
 Jan 19 20:05:00 Desktop kernel: [ 2091.228319] CPU 7
 Jan 19 20:05:00 Desktop kernel: [ 2091.228320] Modules linked in:
 btrfs zlib_deflate crc32c libcrc32c ufs qnx4 hfsplus hfs minix ntfs
 vfat msdos fat jfs xfs exportfs reiserfs cryptd aes_x86_64 aes_generic
 xt_multiport binfmt_misc parport_pc ppdev dm_crypt
 snd_hda_codec_atihdmi snd_hda_codec_realtek ipt_REJECT xt_comment
 xt_limit xt_tcpudp ipt_addrtype xt_state ip6table_filter ip6_tables
 nf_nat_irc snd_hda_intel nf_conntrack_irc nf_nat_ftp nf_nat
 snd_hda_codec nf_conntrack_ipv4 snd_hwdep nf_defrag_ipv4 snd_seq_midi
 snd_pcm snd_rawmidi nf_conntrack_ftp nf_conntrack snd_seq_midi_event
 iptable_filter snd_seq gspca_zc3xx gspca_main ip_tables snd_timer
 snd_seq_device x_tables psmouse videodev v4l1_compat
 v4l2_compat_ioctl32 serio_raw snd i7core_edac soundcore snd_page_alloc
 edac_core lp parport hid_apple usbhid hid radeon firewire_ohci ttm
 firewire_core drm_kms_helper crc_itu_t pata_jmicron ahci usb_storage
 r8169 libahci mii drm i2c_algo_bit
 Jan 19 20:05:00 Desktop kernel: [ 2091.228381]
 Jan 19 20:05:00 Desktop kernel: [ 2091.228384] Pid: 3248, comm: mount
 Tainted: G D 2.6.35-24-generic #42-Ubuntu MSI X58 Pro (MS-7522)
 /MS-7522
 Jan 19 20:05:00 Desktop kernel: [ 2091.228387] RIP: 0010:[] []
 btrfs_test_super+0x10/0x30 [btrfs]
 Jan 19 20:05:00 Desktop kernel: [ 2091.228395] RSP:
 0018:88023649dd18 EFLAGS: 00010283
 Jan 19 20:05:00 Desktop kernel: [ 2091.228397] RAX: 
 RBX: a05cd000 RCX: 880236918d80
 Jan 19 20:05:00 Desktop kernel: [ 2091.228400] RDX: 81154a00
 RSI: 880236918d80 RDI: 880204a4e800
 Jan 19 20:05:00 Desktop kernel: [ 2091.228402] RBP: 88023649dd18
 R08:  R09: 0001
 Jan 19 20:05:00 Desktop kernel: [ 2091.228404] R10: 880236918de8
 R11: 0010 R12: 880204a4e800
 Jan 19 20:05:00 Desktop kernel: [ 2091.228406] R13: a063b250
 R14: 880236918d80 R15: a063b220
 Jan 19 20:05:00 Desktop kernel: [ 2091.228409] FS:
 7f6abca567e0() GS:880001fc()
 knlGS:
 Jan 19 20:05:00 Desktop kernel: [ 2091.228412] CS: 0010 DS:  ES:
  CR0: 80050033
 Jan 19 20:05:00 Desktop kernel: [ 2091.228415] CR2: 0128
 CR3: 00023379d000 CR4: 06e0
 Jan 19 20:05:00 Desktop kernel: [ 2091.228418] DR0: 
 DR1:  DR2: 
 Jan 19 20:05:00 Desktop kernel: [ 2091.228421] DR3: 
 DR6: 0ff0 DR7: 0400
 Jan 19 20:05:00 Desktop kernel: [ 2091.228425] Process mount (pid:
 3248, threadinfo 88023649c000, task 880234ea16e0)
 Jan 19 20:05:00 Desktop kernel: [ 2091.228427] Stack:
 Jan 19 20:05:00 Desktop kernel: [ 2091.228429] 88023649dd68
 81155d52 81154a00 

Re: [PATCH] Avoid a NULL pointer in btrfs

2011-01-20 Thread Liuwenyi

于 2011-1-19 23:52, Chris Mason 写道:

Excerpts from Josef Bacik's message of 2011-01-19 09:14:02 -0500:

On Wed, Jan 19, 2011 at 10:08:13PM +0800, Liuwenyi wrote:

In Yang Ruirui's mail, the btrfs will create a oops. This is caused by a
null pointer in test_range_bit() while lock the spinlock.

So, It is necessary to add a pointer check into test_range_bit()



NAK, the tree shouldn't be null coming into this function, something else is
going wrong.  What oops is this?  Thanks,

The mail is here http://lkml.org/lkml/2011/1/19/24

another mesg is here http://www.aei.mpg.de/~crmafra/dmesg-2.6.35.3.txt

What was your metadata blocksize for this oops?  This call should never
happen.
It is rare and hard to reproduced. So, I update this patch, just avoid a 
null pointer calling.

I think there is a larger problem, probably in the IO error handling
code since the trace had io errors beforehand.

Yes, I agree. This situation is too strange to happen.

-chris

---
Best Regards,
Liu Wenyi
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Btrfs balance

2011-01-20 Thread Andreas Philipp

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi,

Maybe it is a very stupid question but I want to ask it anyway. In
general, 'btrfs filesystem balance' takes very long to finish and
produces lots of IO. So what are the classical usage scenarios, when
it is (really) worth doing a balance?

Thanks,
Andreas Philipp
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQIcBAEBAgAGBQJNODOKAAoJEJIcBJ3+XkgiUisP/A6PywwxIBFj9NuiQ9UAA5vY
QJRn/tXT+Ue2wqgZjhGaqD71Q36ALchSXonX9EXoHWRl0VtrX/2MKkPfEZvBXcDs
yVLOj647HgFu6e51gmdgGvx3qtLsQlFpXBtqYXU8+aeMUUicUZsY8ym+7w6L3jKl
0mKF7nRkdbF0JyBg4NqvbABtBrXEXIEz7hY0oQtFkjuu72iiAriLuKRRkiTnAck9
gkQ1aqcCLLUq7TPQsCdto6s7uSoQPQnZ1zXQ1G1Ij0jUItkU9h9bIjkAcbAjHV4n
cVVF5Zz2lk+z4eAHZwAKgyzzaYW5DT7+ZNrCDOls1CPQr0xka/giRa1dYjS2sas0
GZhPKtCljfROFsOGRs//DcFyu6P3X9WUHM7JRl3v5m0O1EyKlFKMP5O++BNEiB+I
9xUDnYqXzh64MiJBUk5WwGIJuHzZtlfq/PPznWoA2BpO/0/yODKyvd8MkXyEs3ht
3aHi9nbLBe7KqF7CrwH1epchoGKQw/iWopLJMFT6YVL+fHu3CC1aclzekdUh7ktX
ybdW+x575XixhCMrOw9xl0a2dRRIozBYWi5t56rpx8UMkwJwBmvwUOzS1ap9SZLx
c3jSiph8VR8cxtDu/NNFs46iXD/5I7EYlgin3FxD2qrYJOJAcR4d5V08CwGxM+/s
rnskJ6vWv4P71hvevI+R
=XwNW
-END PGP SIGNATURE-

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Btrfs balance

2011-01-20 Thread Helmut Hullen
Hallo, Andreas,

Du meintest am 20.01.11:

 Maybe it is a very stupid question but I want to ask it anyway. In
 general, 'btrfs filesystem balance' takes very long to finish and
 produces lots of IO. So what are the classical usage scenarios, when
 it is (really) worth doing a balance?

Here (Kernel 2.6.37, btrfs git Nov. 2010): balancing two disks/ 
partitions with 2 and 1.5 TByte needs about 24 hours (CPU 1.5 GHz).

What do you mean with lots of IO? the messages in /var/log/messages  
and /var/log/warn?

Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Btrfs balance

2011-01-20 Thread Hugo Mills
On Thu, Jan 20, 2011 at 03:53:41PM +0100, Andreas Philipp wrote:
 On 20.01.2011 14:39, Hugo Mills wrote:
  On Thu, Jan 20, 2011 at 02:07:23PM +0100, Andreas Philipp wrote:
  Hi,
 
  Maybe it is a very stupid question but I want to ask it anyway. In
  general, 'btrfs filesystem balance' takes very long to finish and
  produces lots of IO. So what are the classical usage scenarios, when
  it is (really) worth doing a balance?
 The primary use-cases for balancing are to even out the filesystem
  after adding, removing or changing the size of one of the underlying
  volumes.
 Ok, so this is a little bit like for example resyncing a classical
 raid after it was in degraded mode etc.

   Pretty much exactly that.

 It will also be of use when we finally get around to allowing you
  to change RAID settings on the whole volume, to implement the
  requested changes to the RAID level.
 
 Definitely, a nice feature.
 I'm in the process of implementing balance filters, so that some
  other cases where balancing is useful (reclaiming unused block groups)
  can be run more efficiently by only balancing the bits that need
  doing.
 I have seen your post on balance filters. So then it will be (much)
 faster just because less is done? 

   Yes, that's the idea. If you've lost and replaced a drive from a
2-drive RAID-1 array, there's not much that filters can do for you:
all your data will have to be read and rebuilt. However, if you're
changing just your metadata from DUP to RAID-1, say, or recovering
from the loss of one drive in an 8-drive RAID-1 array, it should be an
awful lot faster with filters.

 When you have a version for trying it out and you need someone for
 testing I will give it a try.

   Thanks. I've got quite a bit reworked now to support multiple
filter types, but I need to do a full review of what I'm doing, and
test it myself first. I probably won't have much time to work on it
before Monday, now.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
 --- emacs: Eats Memory and Crashes. --- 


signature.asc
Description: Digital signature


Re: Encryption

2011-01-20 Thread Hugo Mills
On Thu, Jan 20, 2011 at 07:05:52AM -0800, Carl Cook wrote:
 
 Does BTRFS have subvolume encryption built in?  If not, why?

   Not at the moment.

   My opinion on why: Getting crypto right is *hard*. There are far
easier features that people are asking for that we can implement
first.

   There may be technical issues that make it hard to implement within
btrfs, although being able to do compression is harder from a FS
structure point of view, so I suspect that the issues are more about
ensuring correctness of the crypto implementation (not just the basic
symmetric algorithm, because we've got those in the kernel, but all
the key management and block chaining and probably a bunch of things I
don't know about because I'm not a cryptographer -- all of which makes
a big difference to the security of the final system).

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
 --- Once is happenstance; twice is coincidence; three times --- 
is enemy action. 


signature.asc
Description: Digital signature


Re: Btrfs balance

2011-01-20 Thread Hubert Kario
On Thursday, January 20, 2011 14:40:00 Helmut Hullen wrote:
 Hallo, Andreas,
 
 Du meintest am 20.01.11:
  Maybe it is a very stupid question but I want to ask it anyway. In
  general, 'btrfs filesystem balance' takes very long to finish and
  produces lots of IO. So what are the classical usage scenarios, when
  it is (really) worth doing a balance?
 
 Here (Kernel 2.6.37, btrfs git Nov. 2010): balancing two disks/
 partitions with 2 and 1.5 TByte needs about 24 hours (CPU 1.5 GHz).
 
That's the effect of lots of IO. IMHO it shouldn't take more than 4-8h for 1TB 
7200rpm disks in an otherwise idle system, as such it's rather inefficient 
right now.

-- 
Hubert Kario
QBS - Quality Business Software
02-656 Warszawa, ul. Ksawerów 30/85
tel. +48 (22) 646-61-51, 646-74-24
www.qbs.com.pl
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


btrfs, broken design?

2011-01-20 Thread Benoît Thiébault
Hi everyone,

I am very interested in the features provided by btrfs.

I know it is still under active development and thus do not consider using it 
yet in production, but the Wikipedia page describing btrfs contains a very 
frightening sentence:
Edward Shiskin, one of the Reiser4 developers now working for Redhat, got 
asked in Q2/2010 to look more detailled into Btrfs and judged that it has a 
broken design. This design may lead in some cases to out of space problems.

I have read the linked mail exchange in the mailing list but it is very 
technical and I am not quite sure I understood everything. Could you please 
tell me if the problem has been fixed since?

Is there a planned date for the final release of btrfs?

Kind regards,

Ben--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Adding a disk fails

2011-01-20 Thread Carl Cook

Well I've just tried to add a disk to another, but it fails.  I created the 
first (starting with no traditional partitions) with:
# mkfs.btrfs /dev/sdb

Then I mounted it to /media/backups and put lots of files on it.  I shut down 
the system, added another disk.  Set it up with:
# mkfs.btrfs /dev/sdc
WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using
fs created label (null) on /dev/sdc
nodesize 4096 leafsize 4096 sectorsize 4096 size 1.82TB
Btrfs Btrfs v0.19
# btrfs device scan
Scanning for Btrfs filesystems
#
(... Nothing?  Not even my known mounted sdb drive?)
# btrfs device add /dev/sdc /media/backups
ERROR: error adding the device '/dev/sdc'

It gives no clue as to what might possibly be the problem.  I want raid0.

Also I can not understand this:
Note: While subvolumes can be created anywhere in the filesystem tree, in 
order to be mounted by name a subvolume or snapshot must be in the root of the 
btrfs filesystem.

I want to do this, but do not know what this means.  Tentatively I've created a 
BTRFS volume and mounted it on /media/backups.  I then created subvolumes as 
backup-hex, backup-droog, snaps-hex and snaps-droog.  When I created a snapshot 
it created a subdir under snaps-hex called hex-root.

It won't allow me to remove snapshots. (Debian Testing)

Also does anyone know how to create a shapshot with the current date in the 
name?
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs, broken design?

2011-01-20 Thread Chris Mason
Excerpts from Benoît Thiébault's message of 2011-01-20 16:06:21 -0500:
 Hi everyone,
 
 I am very interested in the features provided by btrfs.
 
 I know it is still under active development and thus do not consider using it 
 yet in production, but the Wikipedia page describing btrfs contains a very 
 frightening sentence:
 Edward Shiskin, one of the Reiser4 developers now working for Redhat, got 
 asked in Q2/2010 to look more detailled into Btrfs and judged that it has a 
 broken design. This design may lead in some cases to out of space problems.
 
 I have read the linked mail exchange in the mailing list but it is very 
 technical and I am not quite sure I understood everything. Could you please 
 tell me if the problem has been fixed since?

There was a bug fixed as part of that discussion, and I think I also
better described the way the tree balancing works to Edward.

 
 Is there a planned date for the final release of btrfs?

A final release?  We'll keep improving things for a long time.  The
biggest missing feature today is btrfsck, which I'm working on full time
right now.

-chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Btrfs balance

2011-01-20 Thread Chris Mason
Excerpts from Andreas Philipp's message of 2011-01-20 08:07:23 -0500:
 
 Hi,
 
 Maybe it is a very stupid question but I want to ask it anyway. In
 general, 'btrfs filesystem balance' takes very long to finish and
 produces lots of IO. So what are the classical usage scenarios, when
 it is (really) worth doing a balance?

The idea behind the balance is to spread the used space across all your
drives evenly.  So you would usually run it after adding a new drive.

It's also useful if your disk has a lot of space allocated to either
data or metadata and you want to return to a more reasonable default.
Josef has a patch to do this more dynamically that we're fixing up
(hopefully for 2.6.38-rc2).

In general, it isn't something that you want to do very often.

-chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs defrag: how does it work?

2011-01-20 Thread Chris Mason
Excerpts from Paul Komkoff's message of 2011-01-19 17:31:56 -0500:
 On Wed, Jan 19, 2011 at 9:25 PM, Chris Mason chris.ma...@oracle.com wrote:
  The defrag code doesn't actually defrag.  It opens up the file and
  recows all the extents and then the delayed allocation code jumps in and
  makes the biggest possible extent that it can.
 
  The reason why you're still seeing extents after running the defrag
  command is because the file hasn't been written yet, so the delayed
  allocation code hasn't kicked in.
 
  If you use btrfs fi defrag -f it'll trigger writeback on the file and
  you should see the results of the defrag sooner.
 
 I tried, and just tried it again, with the same file. I even tried
 doing btrfs fi sync in random order. No matter what I do, it's still
 132 extents :)

Are you using compression?

-chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Adding a disk fails

2011-01-20 Thread Carl Cook

I must have done something wrong because for the past week or so, almost none 
of my questions have been answered here.  I'm pretty much in trouble now 
because I have -no- backups, as I cannot get my backup server running, as I've 
put all my eggs in the btrfs basket.  Am I asking things wrong, or am I 
supposed to be asking somewhere else?


On Thu 20 January 2011 13:18:40 Carl Cook wrote:
 
 Well I've just tried to add a disk to another, but it fails.  I created the 
 first (starting with no traditional partitions) with:
 # mkfs.btrfs /dev/sdb
 
 Then I mounted it to /media/backups and put lots of files on it.  I shut down 
 the system, added another disk.  Set it up with:
 # mkfs.btrfs /dev/sdc
 WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
 WARNING! - see http://btrfs.wiki.kernel.org before using
 fs created label (null) on /dev/sdc
 nodesize 4096 leafsize 4096 sectorsize 4096 size 1.82TB
 Btrfs Btrfs v0.19
 # btrfs device scan
 Scanning for Btrfs filesystems
 #
 (... Nothing?  Not even my known mounted sdb drive?)
 # btrfs device add /dev/sdc /media/backups
 ERROR: error adding the device '/dev/sdc'
 
 It gives no clue as to what might possibly be the problem.  I want raid0.
 
 Also I can not understand this:
 Note: While subvolumes can be created anywhere in the filesystem tree, in 
 order to be mounted by name a subvolume or snapshot must be in the root of 
 the btrfs filesystem.
 
 I want to do this, but do not know what this means.  Tentatively I've created 
 a BTRFS volume and mounted it on /media/backups.  I then created subvolumes 
 as backup-hex, backup-droog, snaps-hex and snaps-droog.  When I created a 
 snapshot it created a subdir under snaps-hex called hex-root.
 
 It won't allow me to remove snapshots. (Debian Testing)
 
 Also does anyone know how to create a shapshot with the current date in the 
 name?
 --
 To unsubscribe from this list: send the line unsubscribe linux-btrfs in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


v0.19-35-g1b444cd btrfsck says snapshots have errors

2011-01-20 Thread Ian! D. Allen
Still getting btrfsck errors with this:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git

# ./btrfstest.sh 
Using /mnt/sdb1 /dev/sdb1 on /dev/sdb
+ mkfs.btrfs -L BTRFStest /dev/sdb1

WARNING! - Btrfs v0.19-35-g1b444cd IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label BTRFStest on /dev/sdb1
nodesize 4096 leafsize 4096 sectorsize 4096 size 2.00GB
Btrfs v0.19-35-g1b444cd
+ mount -o noatime /dev/sdb1 /mnt/sdb1
+ btrfs subvolume snapshot /mnt/sdb1 /mnt/sdb1/snap1
Create a snapshot of '/mnt/sdb1' in '/mnt/sdb1/snap1'
+ btrfs subvolume snapshot /mnt/sdb1/snap1 /mnt/sdb1/snap2
Create a snapshot of '/mnt/sdb1/snap1' in '/mnt/sdb1/snap2'
+ btrfs subvolume snapshot /mnt/sdb1/snap2 /mnt/sdb1/snap3
Create a snapshot of '/mnt/sdb1/snap2' in '/mnt/sdb1/snap3'
+ btrfs subvolume snapshot /mnt/sdb1/snap3 /mnt/sdb1/snap4
Create a snapshot of '/mnt/sdb1/snap3' in '/mnt/sdb1/snap4'
+ btrfs subvolume snapshot /mnt/sdb1/snap4 /mnt/sdb1/snap5
Create a snapshot of '/mnt/sdb1/snap4' in '/mnt/sdb1/snap5'
+ umount /dev/sdb1
+ btrfsck /dev/sdb1
fs tree 256 refs 6 
unresolved ref root 256 dir 256 index 2 namelen 5 name snap1 error 600
unresolved ref root 257 dir 256 index 2 namelen 5 name snap1 error 600
unresolved ref root 258 dir 256 index 2 namelen 5 name snap1 error 600
unresolved ref root 259 dir 256 index 2 namelen 5 name snap1 error 600
unresolved ref root 260 dir 256 index 2 namelen 5 name snap1 error 600
found 49152 bytes used err is 1
total csum bytes: 0
total tree bytes: 49152
total fs tree bytes: 28672
btree space waste bytes: 39360
file data blocks allocated: 0
 referenced 0
Btrfs v0.19-35-g1b444cd

-- 
| Ian! D. Allen  -  idal...@idallen.ca  -  Ottawa, Ontario, Canada
| Home Page: http://idallen.com/   Contact Improv: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs subvolume list fails to show all snapshots

2011-01-20 Thread Ian! D. Allen
Still getting btrfs subvolume list errors with this source:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git

I create ten snapshots, and after creating the tenth one, the sixth one
disappears from btrfs subvolume list:

# btrfs subvolume list /mnt/sdb1
ID 256 top level 5 path snap01
ID 257 top level 5 path snap02
ID 258 top level 5 path snap03
ID 259 top level 5 path snap04
ID 260 top level 5 path snap05
ID 262 top level 5 path snap07
ID 263 top level 5 path snap08
ID 264 top level 5 path snap09
ID 265 top level 5 path snap10

# ls -lt /mnt/sdb1
total 48
drwxr-xr-x 1 root root   42 Jan 20 17:55 ROOT/
dr-xr-xr-x 1 root root  208 Jan 20 17:55 ./
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap01/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap02/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap03/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap04/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap05/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap06/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap07/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap08/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap09/
dr-xr-xr-x 1 root root   28 Jan 20 17:55 snap10/
drwxr-xr-x 4 root root 4096 Jan 20 15:30 ../


On Mon, Dec 13, 2010 at 04:47:22PM +0800, Li Zefan wrote:
  After creating snapshot 10 from snapshot 9, snapshot 6 vanished from
  the output of btrfs subvolume list /dev/sdf1:
  
  # btrfs subv list /mnt/sdf1
  ID 256 top level 5 path snap01
  ID 257 top level 5 path snap02
  ID 258 top level 5 path snap03
  ID 259 top level 5 path snap04
  ID 260 top level 5 path snap05
  ID 262 top level 5 path snap07
  ID 263 top level 5 path snap08
  ID 264 top level 5 path snap09
  ID 265 top level 5 path snap10
  
 ...
  Surely something is wrong here?
  
 
 Right, there's something wrong and I've figured it out.
 Will send out a fix soon.
 Thanks for the report!

-- 
| Ian! D. Allen  -  idal...@idallen.ca  -  Ottawa, Ontario, Canada
| Home Page: http://idallen.com/   Contact Improv: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mv across subvolumes temporarily needs a lot of space

2011-01-20 Thread Niklas Schnelle
I was just moving a 40 GB directory across subvolume boundaries, that is
/mnt/extern/mac to /mnt/extern/backup/homes/mac backup being a
subvolume.
I noticed that df will start to show more used space (starting at 130 GB
going slowly to 165 GB for the whole disk) then shortly after the
operation is done it will show 130 GB again.
So I was wondering will I always need as much as 80% of free space
available to move some big directory or is it just wrong information by
df?
Greetings Niklas


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] btrfs: fix return value check of btrfs_start_transaction()

2011-01-20 Thread Tsutomu Itoh
(2011/01/21 1:09), Josef Bacik wrote:
 I'd rather we go through and have these things return an error than do a
 BUG_ON().  We're moving towards a more stable BTRFS, not one that panics more
 often :).

Yes, I also think so.
This patch is my first step.

My modification policy is as follows:

1. short term
 - To more stable BTRFS, the part that should be corrected is clarified. 
 - The panic is not done by the NULL pointer reference etc.

2. long term
 - BUG_ON() is decreased by using the forced-readonly framework(already posted 
by Liu Bo),
etc. 

Thanks,
Itoh

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: v0.19-35-g1b444cd btrfsck says snapshots have errors

2011-01-20 Thread Yan, Zheng
On Fri, Jan 21, 2011 at 6:52 AM, Ian! D. Allen idal...@idallen.ca wrote:
 Still getting btrfsck errors with this:

 git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git

 # ./btrfstest.sh
 Using /mnt/sdb1 /dev/sdb1 on /dev/sdb
 + mkfs.btrfs -L BTRFStest /dev/sdb1

 WARNING! - Btrfs v0.19-35-g1b444cd IS EXPERIMENTAL
 WARNING! - see http://btrfs.wiki.kernel.org before using

 fs created label BTRFStest on /dev/sdb1
        nodesize 4096 leafsize 4096 sectorsize 4096 size 2.00GB
 Btrfs v0.19-35-g1b444cd
 + mount -o noatime /dev/sdb1 /mnt/sdb1
 + btrfs subvolume snapshot /mnt/sdb1 /mnt/sdb1/snap1
 Create a snapshot of '/mnt/sdb1' in '/mnt/sdb1/snap1'
 + btrfs subvolume snapshot /mnt/sdb1/snap1 /mnt/sdb1/snap2
 Create a snapshot of '/mnt/sdb1/snap1' in '/mnt/sdb1/snap2'
 + btrfs subvolume snapshot /mnt/sdb1/snap2 /mnt/sdb1/snap3
 Create a snapshot of '/mnt/sdb1/snap2' in '/mnt/sdb1/snap3'
 + btrfs subvolume snapshot /mnt/sdb1/snap3 /mnt/sdb1/snap4
 Create a snapshot of '/mnt/sdb1/snap3' in '/mnt/sdb1/snap4'
 + btrfs subvolume snapshot /mnt/sdb1/snap4 /mnt/sdb1/snap5
 Create a snapshot of '/mnt/sdb1/snap4' in '/mnt/sdb1/snap5'
 + umount /dev/sdb1
 + btrfsck /dev/sdb1
 fs tree 256 refs 6
        unresolved ref root 256 dir 256 index 2 namelen 5 name snap1 error 600
        unresolved ref root 257 dir 256 index 2 namelen 5 name snap1 error 600
        unresolved ref root 258 dir 256 index 2 namelen 5 name snap1 error 600
        unresolved ref root 259 dir 256 index 2 namelen 5 name snap1 error 600
        unresolved ref root 260 dir 256 index 2 namelen 5 name snap1 error 600
 found 49152 bytes used err is 1
 total csum bytes: 0
 total tree bytes: 49152
 total fs tree bytes: 28672
 btree space waste bytes: 39360
 file data blocks allocated: 0
  referenced 0
 Btrfs v0.19-35-g1b444cd



These is caused by a design flaw, you can safely ignore them.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] btrfs: fix return value check of btrfs_start_transaction()

2011-01-20 Thread liubo
On 01/21/2011 12:09 AM, Josef Bacik wrote:
 On Thu, Jan 20, 2011 at 03:19:37PM +0900, Tsutomu Itoh wrote:
 The error check of btrfs_start_transaction() is added, and the mistake
 of the error check on several places is corrected. 

 
 I'd rather we go through and have these things return an error than do a
 BUG_ON().  We're moving towards a more stable BTRFS, not one that panics more
 often :).  Thanks,

Great, seems that we all feel it is the time to focus on this. :)

 
 Josef
 --
 To unsubscribe from this list: send the line unsubscribe linux-btrfs in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs subvolume list fails to show all snapshots

2011-01-20 Thread Li Zefan
07:01, Ian! D. Allen wrote:
 Still getting btrfs subvolume list errors with this source:
 
 git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git
 

Just because the fix hasn't been merged into the git tree..

 I create ten snapshots, and after creating the tenth one, the sixth one
 disappears from btrfs subvolume list:
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs, broken design?

2011-01-20 Thread Benoît Thiébault
Thanks for your answer

Le 20 janv. 2011 à 22:20, Chris Mason a écrit :

 There was a bug fixed as part of that discussion, and I think I also
 better described the way the tree balancing works to Edward.

Maybe the wikipedia article should be modified then, because it is not very 
reinsuring :-)

 A final release?  We'll keep improving things for a long time.  The
 biggest missing feature today is btrfsck, which I'm working on full time
 right now.
 
 -chris

Still on the wikipedia page, it's written Btrfs 1.0 (with finalized on-disk 
format) was originally slated for a late 2008 release,[5] but a stable release 
has not been made as of January 2011., which is also very confusing.

According to you, is the version of btrfs in 2.6.37 ready for production? I 
mean, are there still chances that I may loose all my data if I use btrfs?

Last question, do you know when the RAID-5 like capabilities will be available?

Sorry to ask so many questions, I fully understand you and your team are 
working very hard on the project, but I was very confused by the Wikipedia 
article.

Kind regards,

Ben--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] btrfs: fix return value check of btrfs_start_transaction()

2011-01-20 Thread Tsutomu Itoh
(2011/01/21 8:47), Tsutomu Itoh wrote:
 (2011/01/21 1:09), Josef Bacik wrote:
 I'd rather we go through and have these things return an error than do a
 BUG_ON().  We're moving towards a more stable BTRFS, not one that panics more
 often :).
 
 Yes, I also think so.
 This patch is my first step.
 
 My modification policy is as follows:

 1. short term
  - To more stable BTRFS, the part that should be corrected is clarified. 
  - The panic is not done by the NULL pointer reference etc.
This means, even if temporary increase BUG_ON()...

In addition, I think that an important memory allocation should retry several 
times. 
So, I propose the following patches as this sample.

 
 2. long term
  - BUG_ON() is decreased by using the forced-readonly framework(already 
 posted by Liu Bo),
etc. 


This patch retries kmem_cache_alloc() in start_transaction() several times. 

Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com
---
 fs/btrfs/transaction.c |   22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff -urNp linux-2.6.38-rc1/fs/btrfs/transaction.c 
linux-2.6.38-rc1.new/fs/btrfs/transaction.c
--- linux-2.6.38-rc1/fs/btrfs/transaction.c 2011-01-19 08:14:02.0 
+0900
+++ linux-2.6.38-rc1.new/fs/btrfs/transaction.c 2011-01-21 14:08:02.0 
+0900
@@ -22,6 +22,7 @@
 #include linux/writeback.h
 #include linux/pagemap.h
 #include linux/blkdev.h
+#include linux/ratelimit.h
 #include ctree.h
 #include disk-io.h
 #include transaction.h
@@ -175,6 +176,25 @@ static int may_wait_transaction(struct b
return 0;
 }
 
+#define MAX_ITERATIONS 10
+
+static struct btrfs_trans_handle *alloc_trans_handle(void)
+{
+   struct btrfs_trans_handle *ret;
+   int i = 0;
+
+   ret = kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS);
+   if (!ret) {
+   pr_notice_ratelimited(ENOMEM in %s, retrying.\n, __func__);
+   do {
+   yield();
+   ret = kmem_cache_alloc(btrfs_trans_handle_cachep,
+   GFP_NOFS);
+   } while (!ret  i++  MAX_ITERATIONS);
+   }
+   return ret;
+}
+
 static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
u64 num_items, int type)
 {
@@ -185,7 +205,7 @@ static struct btrfs_trans_handle *start_
if (root-fs_info-fs_state  BTRFS_SUPER_FLAG_ERROR)
return ERR_PTR(-EROFS);
 again:
-   h = kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS);
+   h = alloc_trans_handle();
if (!h)
return ERR_PTR(-ENOMEM);
 

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs, broken design?

2011-01-20 Thread Chester
Btrfs has its own wiki page at https://btrfs.wiki.kernel.org which you
may find more helpful than what is on wikipedia.

2011/1/20 Benoît Thiébault benoit.thieba...@gmail.com:
 Thanks for your answer

 Le 20 janv. 2011 à 22:20, Chris Mason a écrit :

 There was a bug fixed as part of that discussion, and I think I also
 better described the way the tree balancing works to Edward.

 Maybe the wikipedia article should be modified then, because it is not very 
 reinsuring :-)

 A final release?  We'll keep improving things for a long time.  The
 biggest missing feature today is btrfsck, which I'm working on full time
 right now.

 -chris

 Still on the wikipedia page, it's written Btrfs 1.0 (with finalized on-disk 
 format) was originally slated for a late 2008 release,[5] but a stable 
 release has not been made as of January 2011., which is also very confusing.

 According to you, is the version of btrfs in 2.6.37 ready for production? I 
 mean, are there still chances that I may loose all my data if I use btrfs?

 Last question, do you know when the RAID-5 like capabilities will be 
 available?

 Sorry to ask so many questions, I fully understand you and your team are 
 working very hard on the project, but I was very confused by the Wikipedia 
 article.

 Kind regards,

 Ben--
 To unsubscribe from this list: send the line unsubscribe linux-btrfs in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Adding a disk fails

2011-01-20 Thread Hubert Kario
On Friday 21 of January 2011 00:10:54 Carl Cook wrote:
 On Thu 20 January 2011 14:13:22 Goffredo Baroncelli wrote:
  To add another disk you don't have to run mkfs.btrfs. For example:
  
  # add the first disk
  mkfs.btrfs /dev/sdb
  # mount the disk
  mount /dev/sdb /media/backups
  
  # add another disk to the first one
  btrfs device add /dev/sdc /media/backup
 
 Thanks Goffredo but as I say, I did this and it responds with
  ERROR: error adding the device '/dev/sdc'
 ... it doesn't give a clue.

You still have a btrfs on /dev/sdc, do a 
dd if=/dev/zero of=/dev/sdc bs=8192
(overkill, but I don't remember which blocks have to be zeroed to destroy 
btrfs superblock)
Then
btrfs dev add /dev/sdc /media backup

 
  Note1: the filesystem has to be mounted
  Note2: the medatada will be in raid1, the data in raid0
  If you shutdown the system, at the reboot you should scan all the
  device in order to find the btrfs ones
  
  # find the btrfs device
  btrfs device scan
 
 This must be done at every boot?  If so, where is recommended, in rc.local?

yes. rc.local is too late, unless you will also mount the volume from there 
and not using /etc/fstab

-- 
Hubert Kario
QBS - Quality Business Software
02-656 Warszawa, ul. Ksawerów 30/85
tel. +48 (22) 646-61-51, 646-74-24
www.qbs.com.pl
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Adding a disk fails

2011-01-20 Thread Helmut Hullen
Hallo, Goffredo,

Du meintest am 20.01.11:

 To add another disk you don't have to run mkfs.btrfs. For example:

 # add the first disk
 mkfs.btrfs /dev/sdb
 # mount the disk
 mount /dev/sdb /media/backups

 # add another disk to the first one
 btrfs device add /dev/sdc /media/backup

   ^backups

 Note1: the filesystem has to be mounted
 Note2: the medatada will be in raid1, the data in raid0

And there seems to be an error; some options tell the sum of the sizes  
of /dev/sdb and /dev/sdc as available size, but perhaps you can only use  
the size of the smaller of the two devices - the system seems to work in  
a kind of RAID1.

The error is known but not yet fixed.

Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Adding a disk fails

2011-01-20 Thread Helmut Hullen
Hallo, Carl,

Du meintest am 20.01.11:

 If you shutdown the system, at the reboot you should scan all the
 device in order to find the btrfs ones

 # find the btrfs device
 btrfs device scan

 This must be done at every boot?

Yes - this advice is added in the Wiki (?).

 If so, where is recommended, in rc.local?

That depends - it has to be done before mounting. And if the device is  
part of the boot partition then you may put the scan command into an  
init-ramdisk.

Viele Gruesse!
Helmut
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html