Re: [PATCH] cleanup duplicates in all tests

2013-04-04 Thread Rich Johnston
Thanks for the review Eric, this patch has been committed. --Rich commit 0efd4f4d483a725212f531bc2ed964de2766b1cd Author: Rich Johnston Date: Wed Apr 3 17:31:49 2013 + xfstests: cleanup duplicates in all tests There are duplicate blank lines, comment hash and lines containin

[bug] xfstests/091 failure on 3.8-btrfs-next

2013-04-04 Thread David Sterba
Hi, default mkfs, mount with noatime, top commit 5710a6f8bb040fd034217c (current next master). 091 crashes reproducibly after a few seconds with: [ 104.492115] [ cut here ] [ 104.496025] kernel BUG at fs/btrfs/extent_io.c:1798! [ 104.496025] invalid opcode: [#1] S

Re: [PATCH V2 1/2] Btrfs: improve the performance of the csums lookup

2013-04-04 Thread Josef Bacik
On Wed, Apr 03, 2013 at 03:07:04AM -0600, Miao Xie wrote: > It is very likely that there are several blocks in bio, it is very > inefficient if we get their csums one by one. This patch improves > this problem by getting the csums in batch. > > According to the result of the following test, the ex

[PATCH] Btrfs-progs: add a free space cache checker to fsck V2

2013-04-04 Thread Josef Bacik
In trying to track down a weird tree log problem I wanted to make sure that the free space cache was actually valid, which we currently have no way of doing. So this patch adds a bunch of support for the free space cache code and then a checker to fsck. Basically we go through and if we can actual

[PATCH] btrfs: close any open devices if btrfs_mount fails

2013-04-04 Thread Eric Sandeen
This: # mkfs.btrfs /dev/sdb{1,2} ; wipefs -a /dev/sdb1; mount /dev/sdb2 /mnt/test would lead to a blkdev open/close mismatch when the mount fails, and a permanently busy (opened O_EXCL) sdb2: # wipefs -a /dev/sdb2 wipefs: error: /dev/sdb2: probing initialization failed: Device or resour

[PATCH] Btrfs: make sure nbytes are right after log replay

2013-04-04 Thread Josef Bacik
While trying to track down a tree log replay bug I noticed that fsck was always complaining about nbytes not being right for our fsynced file. That is because the new fsync stuff doesn't wait for ordered extents to complete, so the inodes nbytes are not necessarily updated properly when we log it.

I/O errors block the entire filesystem

2013-04-04 Thread Alexandre Oliva
I've been trying to figure out the btrfs I/O stack to try to understand why, sometimes (but not always), after a failure to read a (data non-replicated) block from the disk, the file being accessed becomes permanently locked, and the filesystem, unmountable. Sometimes (but not always) it's possibl

[PATCH V2] btrfs: close any open devices if btrfs_mount fails

2013-04-04 Thread Eric Sandeen
This: # mkfs.btrfs /dev/sdb{1,2} ; wipefs -a /dev/sdb1; mount /dev/sdb2 /mnt/test would lead to a blkdev open/close mismatch when the mount fails, and a permanently busy (opened O_EXCL) sdb2: # wipefs -a /dev/sdb2 wipefs: error: /dev/sdb2: probing initialization failed: Device or resour

Re: minimum kernel version for btrfsprogs.0.20?

2013-04-04 Thread Mitch Harder
On 4/3/13, Chris Murphy wrote: > > On Mar 29, 2013, at 9:42 AM, Mitch Harder > wrote: > >> On Fri, Mar 29, 2013 at 1:21 AM, Chris Murphy >> wrote: >>> >>> mkfs.btrfs -l 8192 with kernel 3.9.0 creates a file system mountable by >>> 3.9.0 and only 3.9.0 (so far). And while there's no error making

a scenario of use backup sb by default

2013-04-04 Thread anand jain
-- mkfs.btrfs /dev/dm-4 -f mkfs.ext4 /dev/dm-4 <-- corrupt the primary SB -- as of now -- btrfs fi label /dev/dm-4 "test" btrfs fi label /dev/dm-4 test -- is successful since its using backup super block by default, is this fine ? Thanks, Anand -- To unsubscribe from this list: send

Re: minimum kernel version for btrfsprogs.0.20?

2013-04-04 Thread Chris Murphy
On Apr 4, 2013, at 11:00 AM, Mitch Harder wrote: > > I disagree with cwillu regarding the default setting for extended inode refs. > > While the extended inode refs are a great addition and solve a long > standing problem, it appears only the 3.9.0_rc kernel consistently > works with extended i

[PATCH] Btrfs: log ram bytes properly

2013-04-04 Thread Josef Bacik
When logging changed extents I was logging ram_bytes as the current length, which isn't correct, it's supposed to be the ram bytes of the original extent. This is for compression where even if we split the extent we need to know the ram bytes so when we uncompress the extent we know how big it will

Re: [PATCH V2] btrfs: close any open devices if btrfs_mount fails

2013-04-04 Thread Zach Brown
> It's because btrfs_open_devices() may open some devices, and still > return failure. So the error unwinding needs to close any open > devices in fs_devices before returning. Yeah, looks like. > Note, __btrfs_open_devices is weird; it seems to return success or > failure based on the outcome of

Re: [PATCH V2] btrfs: close any open devices if btrfs_mount fails

2013-04-04 Thread Eric Sandeen
On 4/4/13 1:46 PM, Zach Brown wrote: >> It's because btrfs_open_devices() may open some devices, and still >> return failure. So the error unwinding needs to close any open >> devices in fs_devices before returning. > > Yeah, looks like. > >> Note, __btrfs_open_devices is weird; it seems to retu

Re: [PATCH V2] btrfs: close any open devices if btrfs_mount fails

2013-04-04 Thread Zach Brown
> I guess I had a feeling that in something like a degraded mount scenario > you might live with failures. But I guess that is initiated on the mount > commandline, i.e. "mount this subset; it's degraded" not "mount these devices, > and if some fail that's cool." > > Right? Maybe? Who knows. -

Re: [PATCH V2] btrfs: close any open devices if btrfs_mount fails

2013-04-04 Thread Chris Mason
Quoting Eric Sandeen (2013-04-04 15:45:28) > On 4/4/13 1:46 PM, Zach Brown wrote: > >> It's because btrfs_open_devices() may open some devices, and still > >> return failure. So the error unwinding needs to close any open > >> devices in fs_devices before returning. > > > > Yeah, looks like. > >

[PATCH V3] btrfs: ignore device open failures in __btrfs_open_devices

2013-04-04 Thread Eric Sandeen
This: # mkfs.btrfs /dev/sdb{1,2} ; wipefs -a /dev/sdb1; mount /dev/sdb2 /mnt/test would lead to a blkdev open/close mismatch when the mount fails, and a permanently busy (opened O_EXCL) sdb2: # wipefs -a /dev/sdb2 wipefs: error: /dev/sdb2: probing initialization failed: Device or resour

v6: access to backup superblock

2013-04-04 Thread Anand Jain
We need a mechanism 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. Its been found and posted to the list that check_mounted needs access to the backup-sb and find-root as well. so patch #3 p

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

2013-04-04 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 --- cmds-device.c | 4 ++-- disk-io.c | 3 ++- find-root.c | 3 ++- utils.c | 20 +++- utils.h |

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

2013-04-04 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 back

[PATCH 4/5] btrfs-progs: disable using backup superblock by default

2013-04-04 Thread Anand Jain
except for check_mounted Signed-off-by: Anand Jain --- disk-io.c | 2 +- find-root.c | 2 +- utils.c | 2 +- volumes.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/disk-io.c b/disk-io.c index 82c3b66..589b37a 100644 --- a/disk-io.c +++ b/disk-io.c @@ -881,7 +88

[PATCH 5/5] btrfs-progs: btrfs-find-root should scan backup-sb

2013-04-04 Thread Anand Jain
since idea is to scan and report all the sb in the dev, we should let it so look for backup SB by setting the flag BTRFS_SCAN_BACKUP_SB Signed-off-by: Anand Jain --- find-root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find-root.c b/find-root.c index 27512df..e4ad6

[PATCH 3/5] btrfs-progs: introduce passing flags to btrfs_scan_one_device

2013-04-04 Thread Anand Jain
check_mounted would need to check backup SB to see if the device is mounted to accommodate the situation when the primary SB is corrupted (even in multi dev btrfs). so we need flag to communicate to btrfs_read_dev_super to check backup SB. this patch will just introduce the flag with access to bac

[PATCH 0/9] a bunch of miscellaneous bug fixes

2013-04-04 Thread Anand Jain
Hi David, all kindly review/accept this patch set to fix various bugs as in the patch. This patch set is on top David's integration-20130321 branch and would apply nicely on top the backup sb fixes which was sent separately. Thanks Anand Anand Jain (9):

[PATCH 1/9] [RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck

2013-04-04 Thread Anand Jain
reproducing steps: mkfs.btrfs /dev/dm-2 -f mount /dev/dm-2 /btrfs umount /btrfs btrfs check /dev/dm-2 --repair mount /dev/dm-2 /btrfs btrfs: mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields. btrfs

[PATCH 3/9] btrfs-progs: mkfs should first check all disks before writing to a disk

2013-04-04 Thread Anand Jain
In the cases where one of the disk is not suitable for btrfs, then we would fail the mkfs, however we determine that after we have written btrfs to the preceding disks. At this time if user changes mind for not to use btrfs will left with no choice. So this patch will check if all the provided dis

[PATCH 5/9] [RESEND] btrfs-progs: delete unused function get_mountpt

2013-04-04 Thread Anand Jain
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain --- utils.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/utils.c b/utils.c index 21483b8..9c5dbf4 100644 --- a/utils.c +++ b/utils.c @@ -976,41 +976,6 @@ out_mntloop_err: return ret;

[PATCH 6/9] btrfs-progs: mkfs stdout print to match chronology

2013-04-04 Thread Anand Jain
A trivial fix: To match the events inside to what being printed out before: :: adding device /dev/dm-3 id 2 adding device /dev/dm-4 id 3 adding device /dev/dm-5 id 4 fs created label (null) on /dev/dm-2 nodesize 4096 leafsize 4096 sectorsize 4096 size 213.20GB Btrfs v0.20-rc1-235-gdd21bc1 ---

[PATCH 9/9] btrfs-progs: fix btrfs scrub start help

2013-04-04 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain --- cmds-scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..ebb0dc9 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1465,7 +1465,7 @@ out: } static const char * const cmd_scrub_s

[PATCH 2/9] btrfs-progs: no pending balance is not an error

2013-04-04 Thread Anand Jain
Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. As of now: Signed-off-by: Anand Jain --- cmds-balance.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmds-balance.c b/cmds-balanc

[PATCH 4/9] btrfs-progs: check if btrfs kernel module is loaded

2013-04-04 Thread Anand Jain
when we have to report no such file error for /dev/btrfs-control we could confirm if btrfs kernel module is loaded and report it and skip registration where appropriate Further this patch pretty prints the dev scan results. Signed-off-by: Anand Jain --- cmds-device.c | 56 ++

[PATCH 7/9] btrfs-progs: cmd replace should check target-dev fully

2013-04-04 Thread Anand Jain
as of now in replace command target dev is being checked for mounted and for existing fs, however there is newly introduced __test_dev_for_mkfs in mkfs.c which is suitable for this job, and further it also checks if dev can be opened for with O_EXCL. Its better to use __test_dev_for_mkfs So for th

[PATCH 8/9] btrfs-progs: btrfs-select-super output is confusing when it fails

2013-04-04 Thread Anand Jain
Trivial patch: ./btrfs-progs/btrfs-select-super -s 0 /dev/sdc using SB copy 0, bytenr 65536 No valid Btrfs found on /dev/sdc Open ctree failed The line 'using..' is confusing which gives an indication that command is successful This patch will avoid that when command fails Signed-off-by: Anand J