How to recover uncorrectable errors ?

2013-03-08 Thread Frédéric COIFFIER
Hi, I'm using a Linux 3.7.6 (Gentoo Linux) with btrfs-progs-0.20_rc1_p56 and since few days, I have some uncorrectable errors : # btrfs scrub status / scrub status for 6b6ea99b-edee-498d-bf07-f3a3f1cba2f3 scrub started at Thu Mar 7 20:12:31 2013 and finished after 515 seconds

[PATCH v2] btrfs: enhance superblock checks

2013-03-08 Thread David Sterba
The superblock checksum is not verified upon mount. awkward silence Add that check and also reorder existing checks to a more logical order. Current mkfs.btrfs does not calculate the correct checksum of super_block and thus a freshly created filesytem will fail to mount when this patch is

[PATCH 0/3 v2] flags to access backup SB

2013-03-08 Thread Anand Jain
The bug as seen in the last patch below, indicates that we need a mechanisum to tell when to use the backup super_block. To do this it needs a frame-work, and the patch #1 and #2 below provides the same without change in the logic. The last patch uses the framework to fix the bug. v1-v2:

[PATCH 1/3] btrfs-progs: Introduce flag BTRFS_SCAN_REGISTER to replace run_ioctl

2013-03-08 Thread Anand Jain
Introduce flag BTRFS_SCAN_REGISTER to replace the parameter run_ioctl which controls calling the function btrfs_register_one_device(). Signed-off-by: Anand Jain anand.j...@oracle.com --- btrfsctl.c| 2 +- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c

[PATCH 2/3] btrfs-progs: Introduce flag BTRFS_SCAN_BACKUP_SB for btrfs_read_dev_super

2013-03-08 Thread Anand Jain
As of now btrfs_read_dev_super() reads the backup super block by default and calling function has no control. However in the following patch we would see that is undesirable. So with the flag BTRFS_SCAN_BACKUP_SB the calling function can now indicate if btrfs_read_dev_super should scan for the

[PATCH 3/3] btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device

2013-03-08 Thread Anand Jain
bug: --- mkfs.btrfs /dev/sdb -f yes| mkfs.ext4 /dev/sdb mount /dev/sdb /ext4 mkfs.btrfs -f /dev/sdc /dev/sdd (run twice) mkfs.btrfs -f /dev/sdc /dev/sdd :: ERROR: unable to scan the device '/dev/sdb' - Device or resource busy ERROR: unable to scan the device '/dev/sdb' - Device or resource

[PATCH] btrfs-progs: update the .gitignore file

2013-03-08 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- .gitignore | 10 ++ 1 file changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 230dfbd..a32b96c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,13 @@ find-root mkfs.btrfs repair restore +btrfs-convert

Re: [PATCH 04/14] btrfs-progs: don't leak fd in get_fs_info

2013-03-08 Thread Eric Sandeen
On 3/5/13 5:41 PM, Eric Sandeen wrote: On 3/4/13 4:39 PM, Eric Sandeen wrote: If we discover that a passed-in fd is not a mountpoint, we determine whether it is a device, and issue another open() against the device's mount point if it is mounted. If we do so, ensure this 2nd fd gets closed

[PATCH] Btrfs: return EIO if we have extent tree corruption

2013-03-08 Thread Josef Bacik
The callers of lookup_inline_extent_info all handle getting an error back properly, so return an error if we have corruption instead of being a jerk and panicing. Still WARN_ON() since this is kind of crucial and I've been seeing it a bit too much recently for my taste, I think we're doing

[PATCH V7 -next 25/33] btrfs: add support for read_iter and write_iter

2013-03-08 Thread Dave Kleikamp
btrfs can use generic_file_read_iter(). Base btrfs_file_write_iter() on btrfs_file_aio_write(), then have the latter call the former. Signed-off-by: Dave Kleikamp dave.kleik...@oracle.com Cc: Zach Brown z...@zabbo.net Cc: Chris Mason chris.ma...@fusionio.com Cc: linux-btrfs@vger.kernel.org ---

[GIT PULL] Btrfs updates

2013-03-08 Thread Chris Mason
Hi Linus, Please grab my for-linus: git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus These are scattered fixes and one performance improvement. The biggest functional change is in how we throttle metadata changes. The new code bumps our average file creation rate

[PATCH] use rcu_barrier() to wait for bdev puts at unmount

2013-03-08 Thread Eric Sandeen
Doing this would reliably fail with -EBUSY for me: # mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2 ... unable to open /dev/sdb2: Device or resource busy because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it. Using systemtap to track bdev gets