[PATCH 1/3 v6] btrfs-progs: move out print in cmd_df to another function

2013-09-27 Thread Anand Jain
This is a prepatory work for the btrfs fi show command fixes. So that we have a function get_df to get the fs sizes v6: rebase on 20130920 v5: rebase on 20130909 accepts Davids review comments v4: fixes checkpatch.pl errors as suggested by Wang v3: accepts Zach review comments v2: combined

[PATCH 3/3] btrfs-progs: add more parameter to the filesystem show

2013-09-27 Thread Anand Jain
for mounted btrfs filesystem this patch proposes to add information to also show the mount point and group profile, to help user to quickly understand near details of the btrfs filesystem end user using this new btrfs fi show would surely notice this will reduce other commands normally used

[PATCH 2/3 v3] btrfs-progs: use kernel for mounted disk for show

2013-09-27 Thread Anand Jain
As of now btrfs filesystem show reads directly from disks. So sometimes output can be stale, mainly when user wants to cross verify their operation like, label or device delete or add... etc. so this patch will read from the kernel ioctl if it finds that disk is mounted. v3: rebase on 20130920

[PATCH] Btrfs: relocate csums properly with prealloc extents

2013-09-27 Thread Josef Bacik
A user reported a problem where they were getting csum errors when running a balance and running systemd's journal. This is because systemd is awesome and fallocate()'s its log space and writes into it. Unfortunately we assume that when we read in all the csums for an extent that they are

Re: [PATCH] xfstests/btrfs: do not test btrfs/010 with autodefrag

2013-09-27 Thread Josef Bacik
On Wed, Sep 18, 2013 at 01:17:55PM +0800, Liu Bo wrote: btrfs/010 is going to create a fragmented file, however, with autodefrag this is impossible, so just skip the test when we're with autodefrag. Signed-off-by: Liu Bo bo.li@oracle.com I'd rather you just strip out the autodefrag

[PATCH] xfstests: btrfs/014: add a regression test for snapshot creation

2013-09-27 Thread Josef Bacik
We had a regression where you couldn't snapshot a file system if you mounted it ro and then remounted it rw. This is a test that does just that to make sure we don't have this problem again. I ran the test without the fix and it blew up, and then applied the fix and verified that it passed.

Re: csum questions

2013-09-27 Thread Hugo Mills
On Fri, Sep 27, 2013 at 04:22:16PM +0200, Tom Gundersen wrote: Hi guys, I have some questions about btrfs' handling of invalid csums. For the sake of argument I'm assuming no raid or anything like that (so only one copy exists of every file). When I try to access a file whose csum does

[PATCH] xfstests: btrfs/015 regression test for prealloc with balance

2013-09-27 Thread Josef Bacik
We had a regression where we were not copying csums properly when balancing a prealloc extent. Unfortunately the way this showed up the most was with the csum simply missing, which doesn't result in an error to userspace. So I've copied what generic/310 does and check dmesg for csum errors when

Re: csum questions

2013-09-27 Thread Tom Gundersen
On Fri, Sep 27, 2013 at 4:25 PM, Hugo Mills h...@carfax.org.uk wrote: On Fri, Sep 27, 2013 at 04:22:16PM +0200, Tom Gundersen wrote: 1) What happens to the file. Will btrfs just leave it alone, or will it be deleted from disk (I seem to remember reading this somewhere, just want to confirm)?

compression via chattr

2013-09-27 Thread William Lima
Enabling compression via chattr +c works with ZLIB (default method) only, right? Since there is no way to specify a compression method. Cannot I use LZO this way? Thanks in advance, -- w -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to

Re: balance induced csum errors, systemd-journal

2013-09-27 Thread Johannes Hirte
On Tue, 24 Sep 2013 22:34:20 -0600 Chris Murphy li...@colorremedies.com wrote: OK so I think I'm narrowing this down to just the systemd journal, and it's not checksums that are corrupted, it's the journal itself. I doubt it's systemd-dependent, cause I've seen similar behaviour on a Gentoo

[PATCH v2] btrfs-progs: Make btrfs_header_fsid() return unsigned long

2013-09-27 Thread Ross Kirk
Internally, btrfs_header_fsid() calculates an unsigned long, but casts it to a pointer, while all callers cast it to unsigned long again. Committed to btrfs as fba6aa75654394fccf2530041e9451414c28084f Fix line length issues and match changes to kernelspace Signed-off-by: Ross Kirk

[PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks

2013-09-27 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c | 54 ++ utils.h | 2 ++ 2 files changed, 56 insertions(+) diff --git a/utils.c b/utils.c index c6022fc..ccb5199 100644 --- a/utils.c +++ b/utils.c @@ -1914,6 +1914,57 @@ int

Re: [PATCH] xfstests: btrfs/014: add a regression test for snapshot creation

2013-09-27 Thread Stefan Behrens
On Fri, 27 Sep 2013 09:55:37 -0400, Josef Bacik wrote: We had a regression where you couldn't snapshot a file system if you mounted it ro and then remounted it rw. This is a test that does just that to make sure we don't have this problem again. I ran the test without the fix and it blew

Re: [PATCH] xfstests: btrfs/015 regression test for prealloc with balance

2013-09-27 Thread Stefan Behrens
On Fri, 27 Sep 2013 10:27:33 -0400, Josef Bacik wrote: We had a regression where we were not copying csums properly when balancing a prealloc extent. Unfortunately the way this showed up the most was with the csum simply missing, which doesn't result in an error to userspace. So I've copied

Re: [PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks

2013-09-27 Thread Anand Jain
Following this patch the idea is to use lblkid to scan for the btrfs disks by default which means we don't use BTRFS_SCAN_PROC any more. which implies commands btrfs filesystem show and btrfs device scan will use lblkid to scan disks instead of current /proc/partitions by default. So

Re: compression via chattr

2013-09-27 Thread Liu Bo
On Fri, Sep 27, 2013 at 12:10:03PM -0300, William Lima wrote: Enabling compression via chattr +c works with ZLIB (default method) only, right? Since there is no way to specify a compression method. Cannot I use LZO this way? You can add compress=lzo into your mount options, then chattr +c will

Re: balance induced csum errors, systemd-journal

2013-09-27 Thread Chris Murphy
On Sep 27, 2013, at 9:07 AM, Johannes Hirte johannes.hi...@datenkhaos.de wrote: On Tue, 24 Sep 2013 22:34:20 -0600 Chris Murphy li...@colorremedies.com wrote: OK so I think I'm narrowing this down to just the systemd journal, and it's not checksums that are corrupted, it's the journal

Re: [PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks

2013-09-27 Thread Wang Shilong
Helo Anand, Following this patch the idea is to use lblkid to scan for the btrfs disks by default which means we don't use BTRFS_SCAN_PROC any more. Firstly, i would like to know if we will get any different results between scanning /proc/partions and using lbkid. If not, why we can use

Re: [PATCH] xfstests: btrfs/011 improvement for compressed filesystems

2013-09-27 Thread Jan Schmidt
On Fri, September 13, 2013 at 12:27 (+0200), Stefan Behrens wrote: Josef noticed that using /dev/zero to generate most of the test data doesn't work if someone overides the mount options to enable compression. The test that performs a cancelation failed because the replace operation was

[PATCH] btrfs-progs: calculate disk space that a subvol could free

2013-09-27 Thread Anand Jain
It needs a lot more information about the snapshots if snapshot's life cycle has to be all auto managed by scripts _some day_. this patch is a step towards that. This patch provides the size which would be freed if the subvol/snapshot is deleted. preview: - btrfs su show

[PATCH v2] btrfs-progs: device add should check existing FS before adding

2013-09-27 Thread Anand Jain
as of now, when 'btrfs device add' adds a device it doesn't check if the given device contains an existing FS. This patch will change that to check the same. which when true add will fail, and ask user to use -f option to overwrite. further, since now we have test_dev_for_mkfs() function to check

Re: csum questions

2013-09-27 Thread Zach Brown
2) How may I tell btrfs to ignore all csums and just assume they are all correct? The reason for wanting this is in case the csum is garbled and the file is intact, or the csum is correct and the file is only partially garbled, but may still contain useful data. You can't, right now.

Re: [PATCH] xfstests: btrfs/015 regression test for prealloc with balance

2013-09-27 Thread Zach Brown
+nr_csum_no_found=$(dmesg | grep -c no csum found) +nr_csum_failed=$(dmesg | grep -c csum failed) + +_check_csum_error() +{ + new_csum_no_found=$(dmesg | grep -c no csum found) + new_csum_failed=$(dmesg | grep -c csum failed) + + if [ $nr_csum_no_found -eq $new_csum_no_found

Re: [PATCH v2] btrfs-progs: device add should check existing FS before adding

2013-09-27 Thread Zach Brown
@@ -49,14 +50,17 @@ static int cmd_add_dev(int argc, char **argv) int i, fdmnt, ret=0, e; DIR *dirstream = NULL; int discard = 1; + int force = 0; + char estr[100]; + res = test_dev_for_mkfs(argv[i], force, estr); + if (res) { +

Re: csum questions

2013-09-27 Thread Chris Murphy
On Sep 27, 2013, at 11:51 AM, Zach Brown z...@redhat.com wrote: 2) How may I tell btrfs to ignore all csums and just assume they are all correct? The reason for wanting this is in case the csum is garbled and the file is intact, or the csum is correct and the file is only partially garbled,

[PATCH] Btrfs: do not release metadata for space cache inodes

2013-09-27 Thread Josef Bacik
I've been testing our error paths and I was tripping the BUG_ON() in drop_outstanding_extent because our outstanding_extents is 0 for space cache inodes. This is because we don't reserve metadata space for these inodes since we depend on the global block reserve for our space. To fix this we

Re: [PATCH] btrfs-progs: calculate disk space that a subvol could free

2013-09-27 Thread Zach Brown
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index de246ab..0f36cde 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -809,6 +809,7 @@ static int cmd_subvol_show(int argc, char **argv) int fd = -1, mntfd = -1; int ret = 1; DIR *dirstream1 = NULL, *dirstream2 =

Re: csum questions

2013-09-27 Thread Zach Brown
On Fri, Sep 27, 2013 at 12:47:57PM -0600, Chris Murphy wrote: On Sep 27, 2013, at 11:51 AM, Zach Brown z...@redhat.com wrote: 2) How may I tell btrfs to ignore all csums and just assume they are all correct? The reason for wanting this is in case the csum is garbled and the file is

Re: csum questions

2013-09-27 Thread Chris Murphy
On Sep 27, 2013, at 1:13 PM, Zach Brown z...@redhat.com wrote: On Fri, Sep 27, 2013 at 12:47:57PM -0600, Chris Murphy wrote: On Sep 27, 2013, at 11:51 AM, Zach Brown z...@redhat.com wrote: 2) How may I tell btrfs to ignore all csums and just assume they are all correct? The reason for

extlinux and btrfs RAID-1

2013-09-27 Thread Hugo Mills
I'm trying to get a system booting, and I'm having something of a hard time with it. I'd like to check whether anyone's managed to do what I'm attempting, and whether I'm doing something silly, or just need to upgrade something. I've got two disks, /dev/sda and /dev/sdb, each partitioned

Re: extlinux and btrfs RAID-1

2013-09-27 Thread Chris Murphy
On Sep 27, 2013, at 1:36 PM, Hugo Mills h...@carfax.org.uk wrote: When I boot the machine from its disks, I'm being told that extlinux only supports single-disk btrfs. Is this still the case? I'm pretty sure the answer is yes. The last time I looked not that long ago the multiple device

[PATCH] Btrfs: cleanup transaction on abort

2013-09-27 Thread Josef Bacik
If we abort not during a transaction commit we won't clean up anything until we unmount. Unfortunately if we abort in the middle of writing out an ordered extent we won't clean it up and if somebody is waiting on that ordered extent they will wait forever. To fix this just make the transaction

[PATCH] Btrfs: don't delete ordered roots from list during cleanup

2013-09-27 Thread Josef Bacik
During transaction cleanup after an abort we are just removing roots from the ordered roots list which is incorrect. We have a BUG_ON() to make sure that the root is still part of the ordered roots list when we put our ordered extent which we were tripping in this case. So do like we do

[PATCH] Btrfs: remove all BUG_ON()'s from commit_cowonly_roots

2013-09-27 Thread Josef Bacik
Noticed this when forcing errors to happen during delayed ref running. Thanks, Signed-off-by: Josef Bacik jba...@fusionio.com --- fs/btrfs/transaction.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index

Re: extlinux and btrfs RAID-1

2013-09-27 Thread Hugo Mills
On Fri, Sep 27, 2013 at 02:12:36PM -0600, Chris Murphy wrote: On Sep 27, 2013, at 1:36 PM, Hugo Mills h...@carfax.org.uk wrote: When I boot the machine from its disks, I'm being told that extlinux only supports single-disk btrfs. Is this still the case? I'm pretty sure the answer is

Re: extlinux and btrfs RAID-1

2013-09-27 Thread Chris Murphy
On Sep 27, 2013, at 2:44 PM, Hugo Mills h...@carfax.org.uk wrote: On Fri, Sep 27, 2013 at 02:12:36PM -0600, Chris Murphy wrote: On Sep 27, 2013, at 1:36 PM, Hugo Mills h...@carfax.org.uk wrote: When I boot the machine from its disks, I'm being told that extlinux only supports

Re: extlinux and btrfs RAID-1

2013-09-27 Thread Hugo Mills
On Fri, Sep 27, 2013 at 03:04:22PM -0600, Chris Murphy wrote: On Sep 27, 2013, at 2:44 PM, Hugo Mills h...@carfax.org.uk wrote: On Fri, Sep 27, 2013 at 02:12:36PM -0600, Chris Murphy wrote: On Sep 27, 2013, at 1:36 PM, Hugo Mills h...@carfax.org.uk wrote: When I boot the machine

Re: [PATCH] Btrfs: don't delete ordered roots from list during cleanup

2013-09-27 Thread Zach Brown
On Fri, Sep 27, 2013 at 04:37:46PM -0400, Josef Bacik wrote: During transaction cleanup after an abort we are just removing roots from the ordered roots list which is incorrect. We have a BUG_ON() to make sure that the root is still part of the ordered roots list when we put our ordered

btrfs race conditions on snapshot delete/create

2013-09-27 Thread Marc MERLIN
I had a cronjob that mistakenly created and deleted snapshots in the same place at the same time. Interesting output I got: /var/local/scr/btrfs_snaps: line 23: 26017 Segmentation fault (core dumped) /sbin/btrfs subvolume delete $sub On ubuntu precise (i.e. super ancient), but I upgraded