[PATCH 0/4] Btrfs-progs: cleanups: new helper for parsing string to u64

2014-02-19 Thread Wang Shilong
There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything more gracefully, we introduce a new helper btrfs_strtoull()

[PATCH 4/4] Btrfs-progs: switch to btrfs_strtoull() part3

2014-02-19 Thread Wang Shilong
Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-show-super.c | 7 --- btrfstune.c| 4 ++-- cmds-replace.c | 7 +-- cmds-subvolume.c | 8 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index

[PATCH 3/4] Btrfs-progs: switch to btrfs_strtoull() part2

2014-02-19 Thread Wang Shilong
Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-corrupt-block.c | 38 +- btrfs-debug-tree.c| 2 +- btrfs-image.c | 8 btrfs-map-logical.c | 26 ++ cmds-inspect.c| 8 5 files

[PATCH 2/4] Btrfs-progs: switch to btrfs_strtoull() part1

2014-02-19 Thread Wang Shilong
Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-find-root.c | 23 +++ btrfs-list.c | 14 +++--- cmds-restore.c| 20 utils.c | 2 +- 4 files changed, 11 insertions(+), 48 deletions(-) diff --git

[PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything more gracefully, we introduce a new helper btrfs_strtoull()

[PATCH 3/4] Btrfs: cancel scrub on transaction abortion

2014-02-19 Thread Wang Shilong
If we fail to commit transaction, we'd better cancel scrub operations. Suggested-by: Miao Xie mi...@cn.fujitsu.com Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- fs/btrfs/transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c

[PATCH 2/4] Btrfs: device_replace: fix deadlock for nocow case

2014-02-19 Thread Wang Shilong
commit cb7ab02156e4 cause a following deadlock found by xfstests,btrfs/011: Thread1 is commiting transaction which is blocked at btrfs_scrub_pause(). Thread2 is calling btrfs_file_aio_write() which has held inode's @i_mutex and commit transaction(blocked because Thread1 is committing

[PATCH 1/4] Btrfs: fix a possible deadlock between scrub and transaction committing

2014-02-19 Thread Wang Shilong
btrfs_scrub_continue() will be called when cleaning up transaction.However, this can only be called if btrfs_scrub_pause() is called before. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- fs/btrfs/transaction.c | 22 +++--- 1 file changed, 11 insertions(+), 11

[PATCH 4/4] Btrfs: wake up @scrub_pause_wait as much as we can

2014-02-19 Thread Wang Shilong
check if @scrubs_running=@scrubs_paused condition inside wait_event() is not an atomic operation which means we may inc/dec @scrub_running/ paused at any time. Let's wake up @scrub_pause_wait as much as we can to let commit transaction blocked less. An example below: Thread1

Meaning of no_csum field when scrubbing with -R option

2014-02-19 Thread Sebastian Ochmann
Hello everyone, I have a question: What exactly does the value for no_csum mean when doing a scrub with the -R option? Example output: sudo btrfs scrub start -BR / scrub done for ... ... csum_errors: 0 verify_errors: 0 no_csum: 70517 csum_discards: 87381 super_errors: 0 ...

Incremental backup over writable snapshot

2014-02-19 Thread GEO
Hi, As suggested in another thread, I would like to know the reliability of the following backup scheme: Suppose I have a subvolume of my homedirectory called @home. Now I am interested in making incremental backups of data in home I am interested in, but not everything, so I create a

[PATCH] Btrfs: fix send attempting to rmdir non-empty directories

2014-02-19 Thread Filipe David Borba Manana
The incremental send algorithm assumed that it was possible to issue a directory remove (rmdir) if the the inode number it was currently processing was greater than (or equal) to any inode that referenced the directory's inode. This wasn't a valid assumption because any such inode might be a child

[PATCH] xfstests: add test for btrfs send issuing premature rmdir operations

2014-02-19 Thread Filipe David Borba Manana
Regression test for btrfs incremental send issue where a rmdir instruction is sent against an orphan directory inode which is not empty yet, causing btrfs receive to fail when it attempts to remove the directory. This issue is fixed by the following linux kernel btrfs patch: Btrfs: fix send

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Stefan Behrens
On Wed, 19 Feb 2014 19:17:51 +0800, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
Hello Stefan, On Wed, 19 Feb 2014 19:17:51 +0800, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Goffredo Baroncelli
Hi Wang, On 02/19/2014 12:17 PM, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything more

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
Hi Goffredo, Hi Wang, On 02/19/2014 12:17 PM, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do

[PATCH] btrfs: Allow forced conversion of metadata to dup profile on multiple devices

2014-02-19 Thread Austin S Hemmelgarn
Currently, btrfs balance start fails when trying to convert metadata or system chunks to dup profile on filesystems with multiple devices. This requires that a conversion from a multi-device filesystem to a single device filesystem use the following methodology: 1. btrfs balance start

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Goffredo Baroncelli
Hi Wang, On 02/19/2014 05:08 PM, Wang Shilong wrote: Hi Goffredo, Hi Wang, On 02/19/2014 12:17 PM, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
Hi Goffredo, Hi Wang, On 02/19/2014 05:08 PM, Wang Shilong wrote: Hi Goffredo, Hi Wang, On 02/19/2014 12:17 PM, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right

Re: Incremental backup over writable snapshot

2014-02-19 Thread Chris Murphy
On Feb 19, 2014, at 6:45 AM, GEO 1g2e...@gmail.com wrote: I do not like the idea of making subvolumes of all directories I am not interested in backing up. Why? It addresses your use case. Chris Murphy -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Eric Sandeen
On 2/19/14, 10:31 AM, Goffredo Baroncelli wrote: ... The error message says that the value is out of range. But doesn't tell which is the parameter involved. If you have a command which has several arguments, and the user pass a string instead of a number, the error returned doesn't tell

Re: Incremental backup over writable snapshot

2014-02-19 Thread Chris Murphy
On Feb 19, 2014, at 10:29 AM, GEO 1g2e...@gmail.com wrote: On Wednesday 19 February 2014 10:26:02 you wrote: Snapshotting, deleting a bunch of directories in that snapshot, then backing up the snapshot, then deleting the snapshot will work. But it sounds more involved. But if you're

Re: Incremental backup over writable snapshot

2014-02-19 Thread GEO
On Wednesday 19 February 2014 10:00:49 Chris Murphy wrote: On Feb 19, 2014, at 6:45 AM, GEO 1g2e...@gmail.com wrote: I do not like the idea of making subvolumes of all directories I am not interested in backing up. Why? It addresses your use case. Chris Murphy I would prefer the idea

Re: Read i/o errs and disk replacement

2014-02-19 Thread Wolfgang Mader
On Tuesday 18 February 2014 15:02:51 Chris Murphy wrote: On Feb 18, 2014, at 2:33 PM, Wolfgang Mader wolfgang_ma...@brain-frog.de wrote: Feb 18 13:14:09 deck kernel: ata2.00: failed command: READ DMA Feb 18 13:14:09 deck kernel: ata2.00: cmd c8/00:08:60:f2:30/00:00:00:00:00/e0 tag 0 dma

Re: Incremental backup over writable snapshot

2014-02-19 Thread Kai Krakow
Chris Murphy li...@colorremedies.com schrieb: Snapshotting, deleting a bunch of directories in that snapshot, then backing up the snapshot, then deleting the snapshot will work. But it sounds more involved. But if you're scripting it, probably doesn't matter either way. Will it work as

Re: [PATCH 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
On 02/20/2014 01:23 AM, Eric Sandeen wrote: On 2/19/14, 10:31 AM, Goffredo Baroncelli wrote: ... The error message says that the value is out of range. But doesn't tell which is the parameter involved. If you have a command which has several arguments, and the user pass a string instead of

[PATCH v2 0/4] Btrfs-progs: cleanups: new helper for parsing string to u64

2014-02-19 Thread Wang Shilong
There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything more gracefully, we introduce a new helper arg_strtou64() which

[PATCH v2 2/4] Btrfs-progs: switch to arg_strtou64() part1

2014-02-19 Thread Wang Shilong
switch to arg_strtou64 plus some cleanups to remove unnecessary codes. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-find-root.c | 23 +++ btrfs-list.c | 14 +++--- cmds-restore.c| 27 +-- utils.c | 2 +-

[PATCH v2 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything more gracefully, we introduce a new helper arg_strtou64() which

[PATCH v2 4/4] Btrfs-progs: switch to arg_strtou64() part3

2014-02-19 Thread Wang Shilong
Switch to new helper arg_strtou64(), also check if user assign a valid super copy. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-select-super.c | 12 +--- btrfs-show-super.c | 10 +- btrfstune.c | 4 ++-- cmds-check.c | 14 ++

[PATCH v2 3/4] Btrfs-progs: switch to arg_strtou64() part2

2014-02-19 Thread Wang Shilong
Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com --- btrfs-corrupt-block.c | 45 + btrfs-debug-tree.c| 2 +- btrfs-image.c | 12 ++-- btrfs-map-logical.c | 26 ++ cmds-inspect.c| 8

Re: [PATCH v2 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Eric Sandeen
On 2/19/14, 7:30 PM, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid string. Let's do everything more gracefully,

Re: [PATCH v2 1/4] Btrfs-progs: new helper to parse string to u64 for btrfs

2014-02-19 Thread Wang Shilong
On 02/20/2014 09:39 AM, Eric Sandeen wrote: On 2/19/14, 7:30 PM, Wang Shilong wrote: There are many places that need parse string to u64 for btrfs commands, in fact, we do such things *too casually*, using atoi/atol/atoll..is not right at all, and even we don't check whether it is a valid

[PATCH 2/4] btrfs-progs: fix segment fault when exec btrfs-debug-tree as non-root

2014-02-19 Thread Gui Hecheng
When exec btrfs-debug-tree as non-root user, we get a segment fault. Because the btrfs_scan_block_devices return a success 0 when we fail to open a device. Now we just return the errno if this case happens. Signed-off-by: Gui Hecheng guihc.f...@cn.fujitsu.com --- utils.c | 3 ++- 1 file changed,

[PATCH 3/4] btrfs-progs: fix wrong error msg for exec btrfsck as non-root

2014-02-19 Thread Gui Hecheng
When exec btrfsck as non-root user on a disk, btrfsck will always warn that No such file or directory, despite that a directory (e.g. /dev/vboxusb)actually exists. We just have no permission. In this case, return the -errno set by the opendir call in btrfs_scan_one_dir rather than blindly return

[PATCH 4/4] btrfs-progs: clean the unnecessary error msg of btrfs-file-show

2014-02-19 Thread Gui Hecheng
If the new version of btrfs-file-show fails, it will try to use the old version. But before that, an error msg of the failed ioctl shows up which causes xfstests case btrfs/006 to get a mismatch output. I think we can just remove the error msg since the btrfs-file-show still works with right

[PATCH 1/4] btrfs-progs: judge the return value of check_mounted more accurately

2014-02-19 Thread Gui Hecheng
For btrfs-convert, btrfstune, btrfs rescue, they report device busy when given a device that does not actually exist e.g. # btrfstune -x abcdefg (this device does not exist) $ ...device busy... We deal with this case by add ret 0 error check when judging the return value of

Re: Incremental backup over writable snapshot

2014-02-19 Thread Kai Krakow
Kai Krakow hurikhan77+bt...@gmail.com schrieb: Most of these directories aren't changing anyways most of the time and thus won't occupy disk space only once in the backup. Of course won't should've read would... ;-) -- Replies to list only preferred. -- To unsubscribe from this list: send