[PATCH 0/2] btrfs-progs: prevent mkfs from aborting with small volume

2013-08-23 Thread Hidetoshi Seto
I found that mkfs.btrfs aborts when one of assigned volume is too small. Here are 2 patches to fix 2 independent problems. Both are based on top of Chris's btrfs-progs.git: git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git Thanks, H.Seto Hidetoshi Seto (2):

[PATCH 1/2] btrfs-progs: treat reserved 1MB for superblock properly

2013-08-23 Thread Hidetoshi Seto
I found that mkfs.btrfs aborts when assigned multi volumes contain a small volume: # parted /dev/sdf p Model: LSI MegaRAID SAS RMB (scsi) Disk /dev/sdf: 72.8GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End SizeType File system Flags

Re: [PATCH 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-23 Thread Stefan Behrens
On Mon, 12 Aug 2013 14:33:02 +0300, Ilya Dryomov wrote: Currently btrfs_device is allocated ad-hoc in a few different places, and as a result not all fields are initialized properly. In particular, readahead state is only initialized in device_list_add (at scan time), and not in

Re: [PATCH] Btrfs: remove ourselves from the cluster list under lock

2013-08-23 Thread Miao Xie
On thu, 22 Aug 2013 17:04:59 -0400, Josef Bacik wrote: A user was reporting weird warnings from btrfs_put_delayed_ref() and I noticed that we were doing this list_del_init() on our head ref outside of delayed_refs-lock. This is a problem if we have people still on the list, we could end

Re: Deduplication

2013-08-23 Thread Liu Bo
Hi, On Thu, Aug 22, 2013 at 09:28:09PM +0200, Florian Lindner wrote: Hello, some questions regarding btrfs deduplication. - What is the state of it? Is it safe to use? https://btrfs.wiki.kernel.org/index.php/Deduplication does not yield much information. For inband dedup, it's

Re: Samba strict allocate = yes stops btrfs compression working

2013-08-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/08/13 07:07, Josef Bacik wrote: Not sure what strict allocate = yes does, I've worked on SMB servers before and can answer that. Historically the way Windows apps (right back into the 16 bit days) have made sure there is space for a file

Re: Samba strict allocate = yes stops btrfs compression working

2013-08-23 Thread Mark Ridley
The main reason I started using strict allocate = yes on samba was out of desperation/exasperation with BTRFS. BTRFS stalls from time to time causing SAMBA and/or MSSQL to give up on the dump of a database. From what I have noticed, if for example you dump a 50GB database to samba without strict

[PATCH 2/2] Btrf: cleanup: don't check for root_refs == 0 twice

2013-08-23 Thread Stefan Behrens
btrfs_read_fs_root_no_name() already checks if btrfs_root_refs() is zero and returns ENOENT in this case. There is no need to do it again in three more places. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/file.c | 5 - fs/btrfs/relocation.c | 3 ---

[PATCH 1/2] Btrfs: fix for patch cleanup: don't check the same thing twice

2013-08-23 Thread Stefan Behrens
Mitch Harder noticed that the patch 3c64a1a mentioned in the subject line was causing a kernel BUG() on snapshot deletion. The patch was wrong. It did not handle cached roots correctly. The check for root_refs == 0 was removed everywhere where btrfs_read_fs_root_no_name() had been used to

Re: [PATCH 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-23 Thread Ilya Dryomov
On Fri, Aug 23, 2013 at 10:35 AM, Stefan Behrens sbehr...@giantdisaster.de wrote: This WARN_ON(1) is triggered with the device replace procedure because BTRFS_DEV_REPLACE_DEVID is zero. Ah, a dreaded 0 in C. What a screw up. This came from my rebuild branch where btrfs_init_dev_replace_tgtdev

Re: Samba strict allocate = yes stops btrfs compression working

2013-08-23 Thread Duncan
Mark Ridley posted on Fri, 23 Aug 2013 09:20:04 +0100 as excerpted: I don't want to try nodatacow (which would probably fix the issue), but you lose compression on the whole filesystem, autodefrag doesn't fix it either. I don't do servantware (in the context of my sig) and thus don't do samba

Re: [PATCH 1/2] Btrfs: fix for patch cleanup: don't check the same thing twice

2013-08-23 Thread Miao Xie
On fri, 23 Aug 2013 10:34:42 +0200, Stefan Behrens wrote: Mitch Harder noticed that the patch 3c64a1a mentioned in the subject line was causing a kernel BUG() on snapshot deletion. The patch was wrong. It did not handle cached roots correctly. The check for root_refs == 0 was removed

Re: Samba strict allocate = yes stops btrfs compression working

2013-08-23 Thread Mark Ridley
The speed improvement for dumping large databases through samba with strict allocate = yes to BTRFS was amazing. It reduced a 1 hour dump down to 20 minutes. On 23/08/2013 09:01, Roger Binns rog...@rogerbinns.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/08/13 07:07, Josef

Re: Samba strict allocate = yes stops btrfs compression working

2013-08-23 Thread Mark Ridley
That would be fine, but nodatacow (according to the btrfs wiki) stops compression, so I might as well get the speed benefits of 'strict allocate = yes' which also disables compression. If you want to use BTRFS to store backups then compression has be turned on. Database files like MSSQL usually

Re: [PATCH] Btrfs: don't allow the replace procedure on read only filesystems

2013-08-23 Thread Stefan Behrens
On Fri, 23 Aug 2013 14:54:50 +0800, Wang Shilong wrote: Hey Stefan, On 08/20/2013 12:51 AM, Stefan Behrens wrote: If you start the replace procedure on a read only filesystem, at the end the procedure fails to write the updated dev_items to the chunk tree. The problem is that this error is

Re: Deduplication

2013-08-23 Thread mpe
On 23/08/2013 09:42, Liu Bo wrote: Hi, On Thu, Aug 22, 2013 at 09:28:09PM +0200, Florian Lindner wrote: Hello, some questions regarding btrfs deduplication. - What is the state of it? Is it safe to use? https://btrfs.wiki.kernel.org/index.php/Deduplication does not yield much information.

[PATCH v2 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-23 Thread Ilya Dryomov
Currently btrfs_device is allocated ad-hoc in a few different places, and as a result not all fields are initialized properly. In particular, readahead state is only initialized in device_list_add (at scan time), and not in btrfs_init_new_device (when the new device is added with 'btrfs dev

Re: default mount options 3.10

2013-08-23 Thread Xavier Bassery
On Fri, 23 Aug 2013 11:38:56 +0200 David Kofler dkofle...@googlemail.com wrote: Hi, can someone tell me which mount options are included in defaults mount option? Couldn't find this in BTRFS Wiki. I'm using Debian Wheezy 7.1 and Linux kernel 3.10.6. Thanks in advance. Hi, you've looked at

Re: default mount options 3.10

2013-08-23 Thread Martin Steigerwald
Am Freitag, 23. August 2013, 12:29:42 schrieb Xavier Bassery: On Fri, 23 Aug 2013 11:38:56 +0200 David Kofler dkofle...@googlemail.com wrote: Hi, can someone tell me which mount options are included in defaults mount option? Couldn't find this in BTRFS Wiki. I'm using Debian Wheezy 7.1

Re: [PATCH] xfstests: update filters and output of btrfs/006

2013-08-23 Thread Stefan Behrens
On Fri, 16 Aug 2013 12:10:31 -0500, Eric Sandeen wrote: On 8/16/13 12:02 PM, Stefan Behrens wrote: The btrfs-progs tools changed the output: - 100GiB instead of 100GB - The number of spaces was changed ugh. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- common/filter

[PATCH V4] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-23 Thread Stefan Behrens
Since common/config is executed twice, if SCRATCH_DEV_POOL is configured via the environment, the current code removes the first device entry twice which means that you lose the second device for the test. The fix is to not remove anything from SCRATCH_DEV_POOL anymore. That used to be done (I

[PATCH] xfstest: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL

2013-08-23 Thread Stefan Behrens
One problem was the output of uniq -c which added spaces depending on the size of the count value (e.g. one space less for 10+ devices). The second problem was that btrfs fi show was doing the same: devid %4llu size %s used %s path %s. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de ---

[PATCH][RESEND] xfstests: add a test for btrfs device replace operation

2013-08-23 Thread Stefan Behrens
This test performs btrfs device replace tests with all possible profiles (single/dup/mixed/raid0/raid1/raid10), one round with the '-r' option to 'btrfs replace start' and one round without this option. The cancelation is tested only once and with the dup/single profile for metadata/data. This

[PATCH] xfstests: update _filter_size() for Btrfs

2013-08-23 Thread Stefan Behrens
From: root r...@qvarne.iata The btrfs-progs tools changed the output: - 100GiB instead of 100GB xfstest btrfs/006 is one that failed due to this change. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- common/filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: Samba strict allocate = yes stops btrfs compression working

2013-08-23 Thread Clemens Eisserer
Hi, The speed improvement for dumping large databases through samba with strict allocate = yes to BTRFS was amazing. It reduced a 1 hour dump down to 20 minutes. What you want btrfs to do is to allocate a file of fixed-size on disk in advance, without knowing how large the file will be after

Re: Kernel BUG on Snapshot Deletion (3.11.0-rc5)

2013-08-23 Thread Mitch Harder
On Fri, Aug 23, 2013 at 3:48 AM, Stefan Behrens sbehr...@giantdisaster.de wrote: On Wed, 21 Aug 2013 08:44:55 -0500, Mitch Harder wrote: I've had a hard time assembling a portable reproducer for this issue. I discovered that my reproducer was highly dependent on a local archive of out-of-date

Re: [PATCH 1/2] Btrfs: fix for patch cleanup: don't check the same thing twice

2013-08-23 Thread Mitch Harder
On Fri, Aug 23, 2013 at 4:03 AM, Miao Xie mi...@cn.fujitsu.com wrote: On fri, 23 Aug 2013 10:34:42 +0200, Stefan Behrens wrote: Mitch Harder noticed that the patch 3c64a1a mentioned in the subject line was causing a kernel BUG() on snapshot deletion. The patch was wrong. It did not handle

Re: [PATCH V4] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-23 Thread Josef Bacik
On Fri, Aug 23, 2013 at 03:07:10PM +0200, Stefan Behrens wrote: Since common/config is executed twice, if SCRATCH_DEV_POOL is configured via the environment, the current code removes the first device entry twice which means that you lose the second device for the test. The fix is to not

Re: [PATCH] xfstest: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL

2013-08-23 Thread Josef Bacik
On Fri, Aug 23, 2013 at 03:07:13PM +0200, Stefan Behrens wrote: One problem was the output of uniq -c which added spaces depending on the size of the count value (e.g. one space less for 10+ devices). The second problem was that btrfs fi show was doing the same: devid %4llu size %s used %s

Re: [PATCH] xfstests: update _filter_size() for Btrfs

2013-08-23 Thread Josef Bacik
On Fri, Aug 23, 2013 at 03:07:12PM +0200, Stefan Behrens wrote: From: root r...@qvarne.iata The btrfs-progs tools changed the output: - 100GiB instead of 100GB xfstest btrfs/006 is one that failed due to this change. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de Thank you for

Re: [PATCH][RESEND] xfstests: add a test for btrfs device replace operation

2013-08-23 Thread Josef Bacik
On Fri, Aug 23, 2013 at 03:07:11PM +0200, Stefan Behrens wrote: This test performs btrfs device replace tests with all possible profiles (single/dup/mixed/raid0/raid1/raid10), one round with the '-r' option to 'btrfs replace start' and one round without this option. The cancelation is tested

Re: Help interpreting RAID1 space allocation

2013-08-23 Thread Chris Murphy
On Aug 23, 2013, at 6:05 PM, Joel Johnson mrj...@lixil.net wrote: What is the expectation on hot-adding a failed drive, is an explicit 'device add' or 'replace' expected/required? I'd expect to have to add a device and then remove missing. There isn't a readd option in btrfs, which in md