[PATCH 1/2] Btrfs: fix unprotected alloc list insertion during the finishing procedure of replace

2014-01-30 Thread Miao Xie
the alloc list of the filesystem is protected by -chunk_mutex, we need get that mutex when we insert the new device into the list. Signed-off-by: Miao Xie mi...@cn.fujitsu.com --- fs/btrfs/dev-replace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/btrfs/dev-replace.c

Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send

2014-01-30 Thread Wang Shilong
Hi Josef, On 01/29/2014 10:32 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com I sent a patch to kick off transaction from btrfs send, however it gets a regression that btrfs send try to search extent commit root without transaction protection. To fix this

Re: Re: lost with degraded RAID1

2014-01-30 Thread Johan Kröckel
[Answer from Duncan, 1i5t5.duncan@DOMAIN.HIDDEN (Thanks for the try)] [AFAIK that shouldn't be the case. Degraded should allow the RW mount -- I know it did some kernels ago when I tried it then, and if it changed, it's news to me too, in which case I need to do some reevaluation here.] What I

Re: [PATCH RFCv3 5/6] btrfs: search_ioctl: direct copy to userspace

2014-01-30 Thread Gerhard Heift
2014-01-30 Gerhard Heift gerh...@heift.name: By copying each found item seperatly to userspace, we do not need extra memory in the kernel. This allows to run a large search inside of a single call. Signed-off-by: Gerhard Heift gerh...@heift.name --- fs/btrfs/ioctl.c | 52

Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-01-30 Thread Filipe David Manana
On Thu, Jan 30, 2014 at 3:11 AM, Darrick J. Wong darrick.w...@oracle.com wrote: On Sun, Jan 12, 2014 at 02:22:46AM +, Filipe David Borba Manana wrote: After the change titled Btrfs: add support for inode properties, if btrfs was built-in the kernel (i.e. not as a module), it would cause a

[PATCH] Btrfs: add missing error check in incremental send

2014-01-30 Thread Filipe David Borba Manana
Function wait_for_parent_move() returns negative value if an error happened, 0 if we don't need to wait for the parent's move, and 1 if the wait is needed. Before this change an error return value was being treated like the return value 1, which was not correct. Signed-off-by: Filipe David Borba

Re: [PATCH v2] Btrfs: fix btrfs boot when compiled as built-in

2014-01-30 Thread Filipe David Manana
On Thu, Jan 30, 2014 at 1:18 PM, Filipe David Manana fdman...@gmail.com wrote: On Thu, Jan 30, 2014 at 3:11 AM, Darrick J. Wong darrick.w...@oracle.com wrote: On Sun, Jan 12, 2014 at 02:22:46AM +, Filipe David Borba Manana wrote: After the change titled Btrfs: add support for inode

[PATCH RFCv4] new ioctl TREE_SEARCH_V2

2014-01-30 Thread Gerhard Heift
This patch series first rewrites tree_search to copy found items directly to userspace and then adds a new ioctl TREE_SEARCH_V2 with which we could store them in a varying buffer. Now even items larger than 3992 bytes or a large amount of items can be returned. This is the case for some

[PATCH RFCv4 2/7] btrfs: tree_search, search_ioctl: accept varying buffer

2014-01-30 Thread Gerhard Heift
rewrite search_ioctl to accept a buffer with varying size Signed-off-by: Gerhard Heift gerh...@heift.name --- fs/btrfs/ioctl.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b1c5b4f..9b66eac 100644 ---

[PATCH RFCv4 7/7] btrfs: new ioctl TREE_SEARCH_V2

2014-01-30 Thread Gerhard Heift
This new ioctl call allows the user to supply a buffer of varying size in which a tree search can store its results. This is much more flexible if you want to receive items which are larger than the current fixed buffer of 3992 bytes or if you want to fetch more items at once. Items larger than

[PATCH RFCv4 6/7] btrfs: tree_search, search_ioctl: direct copy to userspace

2014-01-30 Thread Gerhard Heift
By copying each found item seperatly to userspace, we do not need extra buffer in the kernel. Signed-off-by: Gerhard Heift gerh...@heift.name --- fs/btrfs/ioctl.c | 48 +--- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git

[PATCH RFCv4 1/7] btrfs: tree_search: eliminate redundant nr_items check

2014-01-30 Thread Gerhard Heift
If the amount of items reached the given limit of nr_items, we can leave copy_to_sk without updating the key. Also by returning 1 we leave the loop in search_ioctl without rechecking if we reached the given limit. Signed-off-by: Gerhard Heift gerh...@heift.name --- fs/btrfs/ioctl.c | 12

[PATCH RFCv4 4/7] btrfs: tree_search, copy_to_sk: return needed size on EOVERFLOW

2014-01-30 Thread Gerhard Heift
If an item in tree_search is too large to be stored in the given buffer, return the needed size (including the header). Signed-off-by: Gerhard Heift gerh...@heift.name --- fs/btrfs/ioctl.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git

[PATCH RFCv4 3/7] btrfs: tree_search, copy_to_sk: return EOVERFLOW for too small buffer

2014-01-30 Thread Gerhard Heift
In copy_to_sk, if an item is too large for the given buffer, it now returns -EOVERFLOW instead of copying a search_header with len = 0. For backward compatibility for the first item it still copies such a header to the buffer, but not any other following items, which could have fitted.

Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send

2014-01-30 Thread Josef Bacik
On 01/30/2014 04:42 AM, Wang Shilong wrote: Hi Josef, On 01/29/2014 10:32 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com I sent a patch to kick off transaction from btrfs send, however it gets a regression that btrfs send try to search extent commit root without

Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send

2014-01-30 Thread Wang Shilong
Hello Josef, On 01/30/2014 04:42 AM, Wang Shilong wrote: Hi Josef, On 01/29/2014 10:32 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com I sent a patch to kick off transaction from btrfs send, however it gets a regression that btrfs send try to search extent commit

Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send

2014-01-30 Thread Josef Bacik
On 01/30/2014 11:20 AM, Wang Shilong wrote: Hello Josef, On 01/30/2014 04:42 AM, Wang Shilong wrote: Hi Josef, On 01/29/2014 10:32 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com I sent a patch to kick off transaction from btrfs send, however it gets a regression

Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send

2014-01-30 Thread Wang Shilong
在 2014-1-31,上午12:23,Josef Bacik jba...@fb.com 写道: On 01/30/2014 11:20 AM, Wang Shilong wrote: Hello Josef, On 01/30/2014 04:42 AM, Wang Shilong wrote: Hi Josef, On 01/29/2014 10:32 AM, Wang Shilong wrote: From: Wang Shilong wangsl.f...@cn.fujitsu.com I sent a patch to kick off

[PATCH v2] btrfs: add simple debugfs interface

2014-01-30 Thread David Sterba
Help during debugging to export various interesting infromation and tunables without the need of extra mount options or ioctls. Usage: * declare your variable in sysfs.h, and include where you need it * define the variable in sysfs.c and make it visible via debugfs_create_TYPE Depends on

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 29, 2014, at 12:16 PM, Johan Kröckel johan.kroec...@gmail.com wrote: My situation: Former btrfs-RAID1 on two luks encrypted partitions (bunkerA and bunkerB). Disk holding bunkerB died online. Now I started rebalancing bunkerA to single, You're doing an online conversion of a

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 4:53 AM, Johan Kröckel johan.kroec...@gmail.com wrote: [As I said, to the best of my (non-dev btrfs user and list regular) knowledge, mount -o degraded,rw should work.] No, it doesnt. Syslog says: Jan 30 12:44:02 fortknox kernel: [756677.795661] Btrfs: too many

Re: lost with degraded RAID1

2014-01-30 Thread Hugo Mills
On Thu, Jan 30, 2014 at 10:33:21AM -0700, Chris Murphy wrote: On Jan 29, 2014, at 12:16 PM, Johan Kröckel johan.kroec...@gmail.com wrote: My situation: Former btrfs-RAID1 on two luks encrypted partitions (bunkerA and bunkerB). Disk holding bunkerB died online. Now I started

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 10:58 AM, Hugo Mills h...@carfax.org.uk wrote: On Thu, Jan 30, 2014 at 10:33:21AM -0700, Chris Murphy wrote: On Jan 29, 2014, at 12:16 PM, Johan Kröckel johan.kroec...@gmail.com wrote: My situation: Former btrfs-RAID1 on two luks encrypted partitions (bunkerA and

Re: btrfs send requires root

2014-01-30 Thread David Sterba
On Wed, Jan 29, 2014 at 11:26:42AM -0800, Matthew Lai wrote: I have just started playing with btrfs, and noticed that btrfs send only works for root (ERROR: failed to initialize subvol search. Operation not permitted), even on subvolumes created by the user. Am I doing something wrong? Or is

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 11:44 AM, Johan Kröckel johan.kroec...@gmail.com wrote: 2014-01-30 Chris Murphy li...@colorremedies.com: Is this encrypted Btrfs volume used for rootfs? Or is it only for data? If it's only for data, then make sure the volume (all subvolumes) are umounted, then mount

[PATCH] btrfs: Fix 32/64-bit problem with BTRFS_SET_RECEIVED_SUBVOL ioctl

2014-01-30 Thread Hugo Mills
The structure for BTRFS_SET_RECEIVED_IOCTL packs differently on 32-bit and 64-bit systems. This means that it is impossible to use btrfs receive on a system with a 64-bit kernel and 32-bit userspace, because the structure size (and hence the ioctl number) is different. This patch adds a

Stop using btrfs

2014-01-30 Thread Maziarz, Jeremy M.
Everyone, here is a noob question: how do completely delete a btrfs filesystem (RAID10)? $ sudo btrfs filesystem show Label: none uuid: 0ee72c25-9169-4836-873d-468ebdea8c1a Total devices 4 FS bytes used 92.00KB devid1 size 1.82TB used 76.02GB path /dev/sda devid2

Re: btrfs send requires root

2014-01-30 Thread Matthew Lai
Ah I see. Thanks for clarifying! Matthew On 30/01/2014 10:30 AM, David Sterba wrote: On Wed, Jan 29, 2014 at 11:26:42AM -0800, Matthew Lai wrote: I have just started playing with btrfs, and noticed that btrfs send only works for root (ERROR: failed to initialize subvol search. Operation not

Re: Stop using btrfs

2014-01-30 Thread Hugo Mills
On Thu, Jan 30, 2014 at 09:27:55PM +, Maziarz, Jeremy M. wrote: Everyone, here is a noob question: how do completely delete a btrfs filesystem (RAID10)? wipefs, on each device, is the precision approach -- it will very carefully damage the magic number in the first superblock on each

Re: Stop using btrfs

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 2:43 PM, Hugo Mills h...@carfax.org.uk wrote: On Thu, Jan 30, 2014 at 09:27:55PM +, Maziarz, Jeremy M. wrote: Everyone, here is a noob question: how do completely delete a btrfs filesystem (RAID10)? wipefs, on each device, is the precision approach -- it will

Re: [btrfs/i_size] xfstests generic/299 TFAIL

2014-01-30 Thread Josef Bacik
On 01/29/2014 10:54 PM, Fengguang Wu wrote: Hi Steven, We noticed xfstests generic/299 TFAIL on btrfs since commit 9fe55eea7e4b444bafc42facc2d1d2847275 Author: Steven Whitehouse swhit...@redhat.com AuthorDate: Fri Jan 24 14:42:22 2014 + Commit: Al Viro v...@zeniv.linux.org.uk

[PATCH] xfstests: generic/299 can have truncate fail

2014-01-30 Thread Josef Bacik
So this test does lots of fallocate/truncate noise while doing aio overwrites to try and exercise a deadlock found in ext4. Because it runs so hard with ENOSPC it can sometimes cause truncate to fail on btrfs. This is ok and doesn't affect the validity of the test, we just need to catch the

Re: Stop using btrfs

2014-01-30 Thread Maziarz, Jeremy M.
Thanks guys, your suggestions were exactly what I needed. Jeremy On Jan 30, 2014, at 4:51 PM, Chris Murphy li...@colorremedies.com wrote: On Jan 30, 2014, at 2:43 PM, Hugo Mills h...@carfax.org.uk wrote: On Thu, Jan 30, 2014 at 09:27:55PM +, Maziarz, Jeremy M. wrote: Everyone, here

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 4:53 AM, Johan Kröckel johan.kroec...@gmail.com wrote: http://www.spinics.net/lists/linux-btrfs/msg20164.html and Syslog says: Jan 30 12:44:02 fortknox kernel: [756677.795661] Btrfs: too many missing devices, writeable mount is not allowed By the way, the cited patch

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 3:18 PM, Duncan 1i5t5.dun...@cox.net wrote: IOW, I guess I don't agree with that patch as it was apparently committed. There needs to be a force option as well. -o degraded is the force option. I think the problem here is that there's sufficient damage to the one

Re: Snapshots – noob questions

2014-01-30 Thread Chris Murphy
readded list On Jan 30, 2014, at 2:03 PM, KC impacto...@googlemail.com wrote: On 28/01/14 21:16, Chris Murphy wrote: You could also rename /home, create a subvolume home within current subvolume root, then move the files from directory /home_old to the subvolume /home. Now when you

Re: Snapshots – noob questions

2014-01-30 Thread Chris Murphy
I wrote: They could just as well go in a directory called .snapshots, off hand I'm not thinking of an advantage of putting snapshots into a subvolume. There isn't an advantage with a top level 5 subvolume being used for rootfs. But if it's not being mounted, rather other named subvolumes

Re: lost with degraded RAID1

2014-01-30 Thread Duncan
Chris Murphy posted on Thu, 30 Jan 2014 20:00:39 -0700 as excerpted: Another question for Johann is what exact balance command was to go back to single? Was there -dconvert and -mconvert? Both are required to go from raid1/raid to single/DUP or single/single, and actually get rid of the 2nd

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 10:58 PM, Duncan 1i5t5.dun...@cox.net wrote: IOW, just because it's a conversion to single mode doesn't mean we're dropping a device, and a rebalance to single mode wasn't in fact designed to drop a device (that's what device delete is for) Ahh yes, of course. So for

Re: lost with degraded RAID1

2014-01-30 Thread Chris Murphy
On Jan 30, 2014, at 11:10 PM, Chris Murphy li...@colorremedies.com wrote: I'm also seeing many Error reading 1647012864000, -1 with different block addresses (same -1 though), and also 165992304failed to load free space cache for block group also with different numbers. Maybe hundreds

Fwd: lost with degraded RAID1

2014-01-30 Thread Johan Kröckel
2014-01-30 Chris Murphy li...@colorremedies.com: Now the damaged disk disappeared completely. No sign of it in /proc/diskstats. I don't know what you mean by it's disappeared complete. Are you talking about the physical block device? Or the dm logical block device? It failed and doesn't

Re: lost with degraded RAID1

2014-01-30 Thread Johan Kröckel
Sorry, I failed using this list in conjunction with gmail and send most answers to respectively duncan and chris directly. So I sum it up here again: What do you get for: lsblk blkid btrfs device scan --all-devices btrfs fi show root@fortknox:/# lsblk NAME MAJ:MIN RM SIZE RO

GPF on access to presumably corrupted file

2014-01-30 Thread Russell Coker
The attached dmesg log shows the results of trying to cat a file on a BTRFS filesystem when running the latest Debian/Unstable kernel (upstream 3.12.8 with some Debian patches that probably aren't relevant to BTRFS). I've rebooted the Thinkpad in question and repeated the problem after a

Re: lost with degraded RAID1

2014-01-30 Thread Duncan
Chris Murphy posted on Thu, 30 Jan 2014 23:13:36 -0700 as excerpted: On Jan 30, 2014, at 11:10 PM, Chris Murphy li...@colorremedies.com wrote: I'm also seeing many Error reading 1647012864000, -1 with different block addresses (same -1 though), and also 165992304failed to load free