btrfs mount segfaults or crashes after powerloss

2011-03-14 Thread Leon Meßner
Hi, i'm having a problem with a damaged btrfs after power loss. When i try to mount the fs mount either segfaults (trace at bottom) or hangs in "D" state together with [btrfs-transacti]. I tried to btrfsck the filesystem multiple times. It didn't help. Btrfs tools are from todays git. The fs go

Re: cppcheck and btrfs

2011-03-14 Thread Ilya Dryomov
On Tue, Mar 15, 2011 at 07:32:13AM +1100, Chris Samuel wrote: > Hi Chris, et. al, > > I've recently come across cppcheck (static analyser for C code) > and ran it on the current btrfs directory from Linus's repo and > it's reported the following potential issues: > > linux-2.6$ cppcheck -q fs/btr

cppcheck and btrfs

2011-03-14 Thread Chris Samuel
Hi Chris, et. al, I've recently come across cppcheck (static analyser for C code) and ran it on the current btrfs directory from Linus's repo and it's reported the following potential issues: linux-2.6$ cppcheck -q fs/btrfs/ [fs/btrfs/compression.c:343]: (error) Data is allocated but not initiali

Re: [RFE] Add a new super operation for finding block devices in a super

2011-03-14 Thread Josef Bacik
On Mon, Mar 14, 2011 at 12:31:26PM -0400, Christoph Hellwig wrote: > > I think there's a better and more efficient way to archive this. > > We already have a bd_super field in struct block_device. Just > generalize it, and use it from the freeze code instead of doing the > get_active_super loop.

Re: [RFE] Add a new super operation for finding block devices in a super

2011-03-14 Thread Christoph Hellwig
I think there's a better and more efficient way to archive this. We already have a bd_super field in struct block_device. Just generalize it, and use it from the freeze code instead of doing the get_active_super loop. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in

[PATCH 1/2] fs: add super operation contains_bdev

2011-03-14 Thread Josef Bacik
Using get_active_super will not work properly if the fs (like btrfs) does not save it's s_bdev with the device it is on. Also it doesn't provide the entire picture, since an fs can be contained on multiple disks (again like btrfs). So add a super operation that will check to see if the given bloc

[PATCH 2/2] btrfs: implement super op contains_bdev

2011-03-14 Thread Josef Bacik
This patch implements the super op contains_bdev. We just loop through the fs_devices on this super looking for the block device that was requested. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/super.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --gi

[RFE] Add a new super operation for finding block devices in a super

2011-03-14 Thread Josef Bacik
Btrfs can span multiple devices, so sb->s_bdev will not always point to the block device that we are looking to freeze. This isn't a huge issue since the only thing that freezes per-bdev is device-mapper, but if btrfs spans multiple dm devices then we could run into corruption issues as we could e

[PATCH] btrfs-map-logical: usage update

2011-03-14 Thread Arne Jansen
The option to give the number of bytes to read is -b, not -s. Updated usage accordingly. Signed-off-by: Arne Jansen --- btrfs-map-logical.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index aa4b5b5..f4695aa 100644 --- a/btrf

[PATCH] btrfs-map-logical: segfaults when no output file is given

2011-03-14 Thread Arne Jansen
when no output file is given, info_file stays NULL and the following fprintf segfaults. Default to stdout. --- btrfs-map-logical.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index a109c6a..aa4b5b5 100644 --- a/btrfs-map-logica

Re: [PATCH v2] Check for immutable flag in fallocate path

2011-03-14 Thread Marco Stornelli
2011/3/14 Christoph Hellwig : > On Fri, Mar 04, 2011 at 08:39:03AM +1100, Dave Chinner wrote: >> WTF?  Why does append mode have any effect on whether we can punch >> holes in a file or not? There's no justification for adding this in >> the commit message. Why is it even in a patch that is for che

Re: [PATCH v2] Check for immutable flag in fallocate path

2011-03-14 Thread Christoph Hellwig
On Fri, Mar 04, 2011 at 08:39:03AM +1100, Dave Chinner wrote: > WTF? Why does append mode have any effect on whether we can punch > holes in a file or not? There's no justification for adding this in > the commit message. Why is it even in a patch that is for checking > immutable inodes? What is t

Re: [PATCH v3 3/6] btrfs: add scrub code and prototypes

2011-03-14 Thread Arne Jansen
On 14.03.2011 00:50, Ilya Dryomov wrote: On Sat, Mar 12, 2011 at 03:50:42PM +0100, Arne Jansen wrote: This is the main scrub code. + int nstripes; It should be u64 nstripes. A few lines below you assign the stripe length, it is a 64 bit quantity, also do_div() expects a 64 bit divide