[PATCH] btrfs: return btrfs error code for dev excl ops err

2013-08-20 Thread Anand Jain
now threads can return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS as defined in btrfs.h for the dev excl operation error in the FS, which means with this kernel would stop logging (almost an user error) into the /var/log/messages Signed-off-by: Anand Jain anand.j...@oracle.com --- fs/btrfs/ioctl.c

[PATCH] btrfs-progs: use btrfs error code for kernel errors

2013-08-20 Thread Anand Jain
Now with the below kernel patch, the excl operations like dev add/replace/resize and balance returns the btrfs error code defined in btrfs.h, this patch will help btrfs-progs (and thus user) to know the error string on the terminal (instead of /var/log/messages as previously kernel did). This

[PATCH] btrfs-progs: v3, move out print in cmd_df to another function

2013-08-20 Thread Anand Jain
This is a prepatory work for the following btrfs fi show command fixes. So that we have a function get_df to get the fs sizes v3: accepts Zach review comments v2: combined the other patches as below and rebase btrfs-progs: get string for the group profile and type Signed-off-by: Anand Jain

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

2013-08-20 Thread Anand Jain
This seems to be a whole lot of code for a simple iterating printf: struct space_type_thingy_whatver *sp = sargs-spaces; for (i = 0; i sargs-total_spaces; i++, sp++) { printf(%s, %s: total=%s, used=%s\n, group_type_str(sp-flags),

Re: [PATCH] xfstests: add regression test for kernel bz 60673 V2

2013-08-20 Thread Stefan Behrens
On Mon, 19 Aug 2013 16:53:17 -0400, Josef Bacik wrote: There was a problem with send trying to overwrite a file that wasn't actually the same. This is a test to check this particular case where receive fails when it should succeed properly. I tested this to verify it fails without my fix

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread Stefan Behrens
On Mon, 19 Aug 2013 00:35:54 +0200, Stuart Pook wrote: hi Chris thanks for your reply. I was unable to save the filesystem. Even after deleting all but 4Gb I still had too many errors so I just reformated the device. I'm glad that it was my backups and not my data. On 18/08/13 23:43,

Re: Cloning a Btrfs partition

2013-08-20 Thread Xavier Bassery
On Mon, 19 Aug 2013 15:45:32 -0500 (CDT) BJ Quinn b...@placs.net wrote: Ok, so the fix is now in 3.10.6 and I'm using that. I don't get the hang anymore, but now I'm having a new problem. Mount options -- rw,noatime,nodiratime,compress-force=zlib,space_cache,inode_cache,ssd I need

[PATCH 05/12] Btrfs: Make btrfs_device_uuid() return unsigned long

2013-08-20 Thread Geert Uytterhoeven
All callers of btrfs_device_uuid() cast its return type to unsigned long. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/ctree.h |4 ++-- fs/btrfs/volumes.c | 10 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ctree.h

[PATCH 09/12] Btrfs: Make btrfs_header_chunk_tree_uuid() return unsigned long

2013-08-20 Thread Geert Uytterhoeven
Internally, btrfs_header_chunk_tree_uuid() calculates an unsigned long, but casts it to a pointer, while all callers cast it to unsigned long again. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/ctree.c |7 +++ fs/btrfs/ctree.h |5 ++--- fs/btrfs/disk-io.c |

[PATCH 12/12] Btrfs: Use %z to format size_t

2013-08-20 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/check-integrity.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 01f9cc3..3754aa6 100644 --- a/fs/btrfs/check-integrity.c +++

[PATCH 10/12] Btrfs: PAGE_CACHE_SIZE is already unsigned long

2013-08-20 Thread Geert Uytterhoeven
PAGE_CACHE_SIZE == PAGE_SIZE is unsigned long everywhere, so there's no need to cast it to unsigned long. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/check-integrity.c |9 - fs/btrfs/extent_io.c | 18 +- 2 files changed, 13

[PATCH 07/12] Btrfs: Make btrfs_dev_extent_chunk_tree_uuid() return unsigned long

2013-08-20 Thread Geert Uytterhoeven
Internally, btrfs_dev_extent_chunk_tree_uuid() calculates an unsigned long, but casts it to a pointer, while all callers cast it to unsigned long again. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/ctree.h |4 ++-- fs/btrfs/volumes.c |3 +-- 2 files changed, 3

[PATCH 08/12] Btrfs: Make btrfs_header_fsid() return unsigned long

2013-08-20 Thread Geert Uytterhoeven
Internally, btrfs_header_fsid() calculates an unsigned long, but casts it to a pointer, while all callers cast it to unsigned long again. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/ctree.c | 15 +-- fs/btrfs/ctree.h |5 ++--- fs/btrfs/disk-io.c |

[PATCH 00/12] Btrfs: cast cleanups

2013-08-20 Thread Geert Uytterhoeven
Hi Chris, This is a collection of cast cleanups I created after burning my eyes by the btrfs code. - [01/12] Btrfs: Remove superfluous casts from u64 to unsigned long long - [02/12] Btrfs: Make BTRFS_DEV_REPLACE_DEVID an unsigned long long constant - [03/12] Btrfs: Format PAGE_SIZE

[PATCH 04/12] Btrfs: Format mirror_num as int

2013-08-20 Thread Geert Uytterhoeven
mirror_num is always int, hence don't cast it to unsigned long long and format it as a 64-bit number. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/scrub.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index

[PATCH 06/12] Btrfs: Make btrfs_device_fsid() return unsigned long

2013-08-20 Thread Geert Uytterhoeven
All callers of btrfs_device_fsid() cast its return type to unsigned long. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/ctree.h |4 ++-- fs/btrfs/volumes.c |8 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.h

[PATCH 03/12] Btrfs: Format PAGE_SIZE as unsigned long

2013-08-20 Thread Geert Uytterhoeven
PAGE_SIZE is unsigned long everywhere, so there's no need to cast it to unsigned long long and format it as a 64-bit number. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/scrub.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/scrub.c

[PATCH 11/12] Btrfs: Do not truncate sector_t on 32-bit with CONFIG_LBDAF=y

2013-08-20 Thread Geert Uytterhoeven
sector_t may be either u64 (always 64 bit) or unsigned long (32 or 64 bit). Casting it to unsigned long will truncate it on 32-bit platforms where CONFIG_LBDAF=y. Cast to unsigned long long and format using ll instead. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org ---

[PATCH 02/12] Btrfs: Make BTRFS_DEV_REPLACE_DEVID an unsigned long long constant

2013-08-20 Thread Geert Uytterhoeven
The internal btrfs device id is a u64, hence make the constant BTRFS_DEV_REPLACE_DEVID unsigned long long as well, so we no longer need a cast to print it. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/ctree.h |2 +- fs/btrfs/dev-replace.c |2 +- 2 files

Re: [PATCH] xfstests: add regression test for kernel bz 60673 V2

2013-08-20 Thread Eric Sandeen
On 8/20/13 4:14 AM, Stefan Behrens wrote: On Mon, 19 Aug 2013 16:53:17 -0400, Josef Bacik wrote: There was a problem with send trying to overwrite a file that wasn't actually the same. This is a test to check this particular case where receive fails when it should succeed properly. I

Re: [PATCH] xfstests: add regression test for kernel bz 60673 V2

2013-08-20 Thread Josef Bacik
On Tue, Aug 20, 2013 at 11:14:53AM +0200, Stefan Behrens wrote: On Mon, 19 Aug 2013 16:53:17 -0400, Josef Bacik wrote: There was a problem with send trying to overwrite a file that wasn't actually the same. This is a test to check this particular case where receive fails when it

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread slp644161
Stefan Behrens sbehr...@giantdisaster.de wrote: Do you still have the kernel log files around that had been written while you ran the replace procedure? /var/log/messages*. Could you share these files (via personal mail if the files are too huge). Yes I still have them. I'm away at the moment

Re: [PATCH 01/12] Btrfs: Remove superfluous casts from u64 to unsigned long long

2013-08-20 Thread Eric Sandeen
On 8/20/13 6:20 AM, Geert Uytterhoeven wrote: u64 is unsigned long long on all architectures now, so there's no need to cast it when formatting it using the ll length modifier. Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org --- fs/btrfs/backref.c | 24 ++--

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread slp644161
Chris Murphy li...@colorremedies.com wrote: I ran a badblocks scan on the raw device (not the luks device) and didn't get any errors. badblocks will depend on the drive determining a persistent read failure with a sector, and timing out before the SCSI block layer times out. Since the linux

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread Stefan Behrens
On Tue, 20 Aug 2013 15:52:27 +0200, slp644161 wrote: Stefan Behrens sbehr...@giantdisaster.de wrote: Do you still have the kernel log files around that had been written while you ran the replace procedure? /var/log/messages*. Could you share these files (via personal mail if the files are

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread Stefan Behrens
On Tue, 20 Aug 2013 16:46:59 +0200, slp644161 wrote: Chris Murphy li...@colorremedies.com wrote: I ran a badblocks scan on the raw device (not the luks device) and didn't get any errors. badblocks will depend on the drive determining a persistent read failure with a sector, and timing out

Re: Cloning a Btrfs partition

2013-08-20 Thread BJ Quinn
The use of writable snapshots isn't necessary. It's just what I had to start with. I'm sure I could switch to using read only snapshots exclusively to skip the additional steps. As for the throughput, the disparity between actual speed and a speed I might expect to achieve is that much greater

Re: BUG at fs/btrfs/relocation.c:1055 during balance.

2013-08-20 Thread Josef Bacik
On Mon, Aug 19, 2013 at 11:44:19PM +0200, Lutz Euler wrote: Hi, during a balance I got the BUG from the subject line, followed by BUG: unable to handle kernel paging request at 0008a940. The machine needed to be rebooted afterwards; the filesystem was successfully mounted and the

[PATCH] Btrfs: fix printing of non NULL terminated string

2013-08-20 Thread Filipe David Borba Manana
The name buffer is not terminated by a '\0' character, therefore it needs to be printed with %.*s and use the length of the buffer. Signed-off-by: Filipe David Borba Manana fdman...@gmail.com --- fs/btrfs/delayed-inode.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

btrfs check : extent-tree.c:283: find_search_start: Assertion `!(1)' failed

2013-08-20 Thread Miguel Negrão
Hi, I have a btrfs partition on a usb external hard drive which doesn't mount anymore. I tried doing a btrfs check on it, but it fails with the error on the subject. The btrfs progs were compiled from git today. I have a backup of this partition elsewhere, so I can restore from there if all else

Re: BUG at fs/btrfs/relocation.c:1055 during balance.

2013-08-20 Thread Lutz Euler
Josef Bacik wrote: On Mon, Aug 19, 2013 at 11:44:19PM +0200, Lutz Euler wrote: Hi, during a balance I got the BUG from the subject line, followed by BUG: unable to handle kernel paging request at 0008a940. This should be fixed in btrfs-next. Thanks, Thanks for the info. That

Re: BUG at fs/btrfs/relocation.c:1055 during balance.

2013-08-20 Thread Josef Bacik
On Tue, Aug 20, 2013 at 07:17:23PM +0200, Lutz Euler wrote: Josef Bacik wrote: On Mon, Aug 19, 2013 at 11:44:19PM +0200, Lutz Euler wrote: Hi, during a balance I got the BUG from the subject line, followed by BUG: unable to handle kernel paging request at 0008a940. This

Re: [PATCH] btrfs: return btrfs error code for dev excl ops err

2013-08-20 Thread Josef Bacik
On Tue, Aug 20, 2013 at 02:10:54PM +0800, Anand Jain wrote: now threads can return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS as defined in btrfs.h for the dev excl operation error in the FS, which means with this kernel would stop logging (almost an user error) into the /var/log/messages

Re: [PATCH] btrfs: reuse kbasename helper

2013-08-20 Thread Josef Bacik
On Mon, Aug 12, 2013 at 02:41:10PM +0300, Andy Shevchenko wrote: To get name of the file from a pathname let's use kbasename() helper. It allows to simplify code a bit. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com Introduces a compile error fs/btrfs/send.c: In function

Re: [PATCH 3/3] btrfs-progs: avoid write to the disk before sure to create fs

2013-08-20 Thread Josef Bacik
On Wed, Aug 07, 2013 at 08:11:25PM +0800, Anand Jain wrote: This patch provides fix for the following bug, When mkfs.btrfs fails the disks shouldn't be written. btrfs fi show /dev/sdb Label: none uuid: 60fb76f4-3b4d-4632-a7da-6a44dea5573d Total devices 1 FS bytes used

Re: BUG at fs/btrfs/relocation.c:1055 during balance.

2013-08-20 Thread Lutz Euler
Josef Bacik wrote: Yup it's Btrfs: change how we queue blocks for backref checking Thanks, found it. Greetings, Lutz -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH] Btrfs: fix send to deal with sparse files properly

2013-08-20 Thread Josef Bacik
Send was just sending everything it found, even if the extent was a hole. This is unpleasant for users, so just skip holes when we are sending. This will also skip sending prealloc extents since the send spec doesn't have a prealloc command. Eventually we will add a prealloc command and rev the

Re: [PATCH 3/3] btrfs-progs: avoid write to the disk before sure to create fs

2013-08-20 Thread Anand Jain
On 08/21/2013 03:19 AM, Josef Bacik wrote: On Wed, Aug 07, 2013 at 08:11:25PM +0800, Anand Jain wrote: This patch provides fix for the following bug, When mkfs.btrfs fails the disks shouldn't be written. btrfs fi show /dev/sdb Label: none uuid:

[PATCH v2] btrfs: return btrfs error code for dev excl ops err

2013-08-20 Thread Anand Jain
now threads can return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS as defined in btrfs.h for the dev excl operation error in the FS, which means with this kernel would stop logging (almost an user error) into the /var/log/messages v2: accepts Josef' comment Signed-off-by: Anand Jain

Re: [PATCH] btrfs: return btrfs error code for dev excl ops err

2013-08-20 Thread Anand Jain
- return add/delete/balance/replace/resize operation \ - in progress; + return add/delete/balance/replace/resize operation in progress; default: return NULL; This is an