[PATCH v3 5/5] btrfs-progs: scrub added to manpage

2011-07-18 Thread Jan Schmidt
Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- man/btrfs.8.in | 64 +++- 1 files changed, 63 insertions(+), 1 deletions(-) diff --git a/man/btrfs.8.in b/man/btrfs.8.in index e1a6ad9..84a60cd 100644 --- a/man/btrfs.8.in +++ b/man

[PATCH v3 3/5] btrfs-progs: added check_mounted_where

2011-07-18 Thread Jan Schmidt
new version of check_mounted() returning more information gathered while searching. check_mounted() is now a wrapper for check_mounted_where(). the new version is needed by scrub.c Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- utils.c | 29 ++--- utils.h

[PATCH v3 4/5] btrfs-progs: scrub userland implementation

2011-07-18 Thread Jan Schmidt
Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- scrub.c | 1666 +++ 1 files changed, 1666 insertions(+), 0 deletions(-) diff --git a/scrub.c b/scrub.c new file mode 100644 index 000..9dca5f6 --- /dev/null +++ b/scrub.c

[PATCH v3 2/5] btrfs-progs: scrub ioctls

2011-07-18 Thread Jan Schmidt
- scrub structs added - ioctls for scrub - BTRFS_FSID_SIZE moved Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- ctree.h |2 +- ioctl.h | 54 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/ctree.h b/ctree.h

Re: [PATCH v3 4/8] scrub: bugfix: mirror_num off by one

2011-07-19 Thread Jan Schmidt
On 07.07.2011 17:48, Jan Schmidt wrote: Fix the mirror_num determination in scrub_stripe. The rest of the scrub code did not use mirror_num for anything important and that error went unnoticed. ^ This just turned out not to be the case. Please ignore

[PATCH v4 5/8] add mirror_num to extent_read_full_page

2011-07-19 Thread Jan Schmidt
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/disk-io.c |2 +- fs

[PATCH v4 6/8] scrub: use int for mirror_num, not u64

2011-07-19 Thread Jan Schmidt
the rest of the code uses int mirror_num, and so should scrub Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 59caf8f..41a0114 100644 --- a/fs/btrfs

[PATCH v4 2/8] scrub: added unverified_errors

2011-07-19 Thread Jan Schmidt
carrying such conspicous events to the administrator should already be around. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

[PATCH v4 4/8] scrub: bugfix: mirror_num off by one

2011-07-19 Thread Jan Schmidt
Fix the mirror_num determination in scrub_stripe. The rest of the scrub code did not use mirror_num for anything important and that error went unnoticed. The nodatasum fixup patch of this set depends on a correct mirror_num. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs

[PATCH v4 7/8] scrub: add fixup code for errors on nodatasum files

2011-07-19 Thread Jan Schmidt
is expected to clear the newly introduced EXTENT_DAMAGED flag, making scrub report that error as corrected instead of uncorrectable eventually. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/extent_io.h |1 + fs/btrfs/scrub.c | 188

[PATCH v4 8/8] new ioctls to do logical-inode and inode-path resolving

2011-07-19 Thread Jan Schmidt
these ioctls make use of the new functions initially added for scrub. they return all inodes belonging to a logical address (BTRFS_IOC_LOGICAL_INO) and all paths belonging to an inode (BTRFS_IOC_INO_PATHS). Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/ioctl.c | 134

[PATCH v4 3/8] scrub: print paths of corrupted files

2011-07-19 Thread Jan Schmidt
While scrubbing, we may encounter various errors. Previously, a logical address was printed to the log only. Now, all paths belonging to that address are resolved and printed separately. That should work for hardlinks as well as reflinks. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

[PATCH v4 1/8] added helper functions to iterate backrefs

2011-07-19 Thread Jan Schmidt
These helper functions iterate back references and call a function for each backref. There is also a function to resolve an inode to a path in the file system. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/Makefile |3 +- fs/btrfs/backref.c | 748

[PATCH v4 0/8] Btrfs: scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-19 Thread Jan Schmidt
-fs_info - based on current cmason/for-linus Changelog v3-v4: - fixed a regression with mirror_num that could prevent error correction - based on current cmason/for-linus Please try it and report errors (or confirm there are none, of course). -Jan Jan Schmidt (8): added helper functions

[PATCH v5 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-21 Thread Jan Schmidt
on current cmason/for-linus Changelog v3-v4: - fixed a regression with mirror_num that could prevent error correction - based on current cmason/for-linus Please try it and report errors (or confirm there are none, of course). I can provide a place to pull from if anyone likes. -Jan Jan Schmidt (8

[PATCH v5 2/8] btrfs scrub: added unverified_errors

2011-07-21 Thread Jan Schmidt
carrying such conspicous events to the administrator should already be around. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

[PATCH v5 5/8] btrfs: add mirror_num to extent_read_full_page

2011-07-21 Thread Jan Schmidt
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/disk-io.c |2 +- fs

[PATCH v5 8/8] btrfs: new ioctls to do logical-inode and inode-path resolving

2011-07-21 Thread Jan Schmidt
these ioctls make use of the new functions initially added for scrub. they return all inodes belonging to a logical address (BTRFS_IOC_LOGICAL_INO) and all paths belonging to an inode (BTRFS_IOC_INO_PATHS). Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/ioctl.c | 134

[PATCH v5 4/8] btrfs scrub: bugfix: mirror_num off by one

2011-07-21 Thread Jan Schmidt
Fix the mirror_num determination in scrub_stripe. The rest of the scrub code did not use mirror_num for anything important and that error went unnoticed. The nodatasum fixup patch of this set depends on a correct mirror_num. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs

[PATCH v5 7/8] btrfs scrub: add fixup code for errors on nodatasum files

2011-07-21 Thread Jan Schmidt
is expected to clear the newly introduced EXTENT_DAMAGED flag, making scrub report that error as corrected instead of uncorrectable eventually. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/extent_io.h |1 + fs/btrfs/scrub.c | 188

[PATCH v5 3/8] btrfs scrub: print paths of corrupted files

2011-07-21 Thread Jan Schmidt
While scrubbing, we may encounter various errors. Previously, a logical address was printed to the log only. Now, all paths belonging to that address are resolved and printed separately. That should work for hardlinks as well as reflinks. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

[PATCH v5 6/8] btrfs scrub: use int for mirror_num, not u64

2011-07-21 Thread Jan Schmidt
the rest of the code uses int mirror_num, and so should scrub Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 59caf8f..41a0114 100644 --- a/fs/btrfs

[PATCH v5 1/8] btrfs: added helper functions to iterate backrefs

2011-07-21 Thread Jan Schmidt
These helper functions iterate back references and call a function for each backref. There is also a function to resolve an inode to a path in the file system. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/Makefile |3 +- fs/btrfs/backref.c | 748

Re: [PATCH v5 8/8] btrfs: new ioctls to do logical-inode and inode-path resolving

2011-07-22 Thread Jan Schmidt
On 21.07.2011 22:14, Andi Kleen wrote: Jan Schmidt list.bt...@jan-o-sch.net writes: + +static long btrfs_ioctl_logical_to_ino(struct btrfs_root *root, +void __user *arg) +{ +int ret = 0; +int size; +u64 extent_offset; +struct

Re: Broken btrfs?

2011-07-22 Thread Jan Schmidt
On 21.07.2011 23:13, Jan Schubert wrote: On 07/18/2011 10:29 AM, Jan Schmidt wrote: If you are on a 3.0 kernel, get the most current version of btrfs tools from Hugo's integration-20110705 branch at http://git.darksatanic.net/repo/btrfs-progs-unstable.git/ and do a scrub. -Jan Thx Jan, I

[PATCH v6 4/8] btrfs scrub: bugfix: mirror_num off by one

2011-07-22 Thread Jan Schmidt
Fix the mirror_num determination in scrub_stripe. The rest of the scrub code did not use mirror_num for anything important and that error went unnoticed. The nodatasum fixup patch of this set depends on a correct mirror_num. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs

[PATCH v6 8/8] btrfs: new ioctls to do logical-inode and inode-path resolving

2011-07-22 Thread Jan Schmidt
these ioctls make use of the new functions initially added for scrub. they return all inodes belonging to a logical address (BTRFS_IOC_LOGICAL_INO) and all paths belonging to an inode (BTRFS_IOC_INO_PATHS). Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/ioctl.c | 145

[PATCH v6 1/8] btrfs: added helper functions to iterate backrefs

2011-07-22 Thread Jan Schmidt
These helper functions iterate back references and call a function for each backref. There is also a function to resolve an inode to a path in the file system. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/Makefile |3 +- fs/btrfs/backref.c | 748

[PATCH v6 7/8] btrfs scrub: add fixup code for errors on nodatasum files

2011-07-22 Thread Jan Schmidt
is expected to clear the newly introduced EXTENT_DAMAGED flag, making scrub report that error as corrected instead of uncorrectable eventually. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/extent_io.h |1 + fs/btrfs/scrub.c | 188

[PATCH v6 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-22 Thread Jan Schmidt
to pull from if anyone likes. -Jan Jan Schmidt (8): btrfs: added helper functions to iterate backrefs btrfs scrub: added unverified_errors btrfs scrub: print paths of corrupted files btrfs scrub: bugfix: mirror_num off by one btrfs: add mirror_num to extent_read_full_page btrfs scrub

[PATCH v6 2/8] btrfs scrub: added unverified_errors

2011-07-22 Thread Jan Schmidt
carrying such conspicous events to the administrator should already be around. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

[PATCH v6 6/8] btrfs scrub: use int for mirror_num, not u64

2011-07-22 Thread Jan Schmidt
the rest of the code uses int mirror_num, and so should scrub Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 59caf8f..41a0114 100644 --- a/fs/btrfs

[PATCH v6 5/8] btrfs: add mirror_num to extent_read_full_page

2011-07-22 Thread Jan Schmidt
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/disk-io.c |2 +- fs

[PATCH v6 3/8] btrfs scrub: print paths of corrupted files

2011-07-22 Thread Jan Schmidt
While scrubbing, we may encounter various errors. Previously, a logical address was printed to the log only. Now, all paths belonging to that address are resolved and printed separately. That should work for hardlinks as well as reflinks. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

[PATCH v7 4/8] btrfs scrub: bugfix: mirror_num off by one

2011-07-22 Thread Jan Schmidt
Fix the mirror_num determination in scrub_stripe. The rest of the scrub code did not use mirror_num for anything important and that error went unnoticed. The nodatasum fixup patch of this set depends on a correct mirror_num. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs

[PATCH v7 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-22 Thread Jan Schmidt
, of course). I can provide a place to pull from if anyone likes. -Jan Jan Schmidt (8): btrfs: added helper functions to iterate backrefs btrfs scrub: added unverified_errors btrfs scrub: print paths of corrupted files btrfs scrub: bugfix: mirror_num off by one btrfs: add mirror_num

[PATCH v7 8/8] btrfs: new ioctls to do logical-inode and inode-path resolving

2011-07-22 Thread Jan Schmidt
these ioctls make use of the new functions initially added for scrub. they return all inodes belonging to a logical address (BTRFS_IOC_LOGICAL_INO) and all paths belonging to an inode (BTRFS_IOC_INO_PATHS). Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/ioctl.c | 150

[PATCH v7 3/8] btrfs scrub: print paths of corrupted files

2011-07-22 Thread Jan Schmidt
While scrubbing, we may encounter various errors. Previously, a logical address was printed to the log only. Now, all paths belonging to that address are resolved and printed separately. That should work for hardlinks as well as reflinks. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

[PATCH v7 2/8] btrfs scrub: added unverified_errors

2011-07-22 Thread Jan Schmidt
carrying such conspicous events to the administrator should already be around. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

[PATCH v7 5/8] btrfs: add mirror_num to extent_read_full_page

2011-07-22 Thread Jan Schmidt
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/disk-io.c |2 +- fs

[PATCH v7 7/8] btrfs scrub: add fixup code for errors on nodatasum files

2011-07-22 Thread Jan Schmidt
is expected to clear the newly introduced EXTENT_DAMAGED flag, making scrub report that error as corrected instead of uncorrectable eventually. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/extent_io.h |1 + fs/btrfs/scrub.c | 188

[PATCH v7 1/8] btrfs: added helper functions to iterate backrefs

2011-07-22 Thread Jan Schmidt
These helper functions iterate back references and call a function for each backref. There is also a function to resolve an inode to a path in the file system. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/Makefile |3 +- fs/btrfs/backref.c | 748

[RFC PATCH 0/4] btrfs: Suggestion for raid auto-repair

2011-07-22 Thread Jan Schmidt
when you combine those two patch series, I did not include it. -Jan Jan Schmidt (4): btrfs: btrfs_multi_bio replaced with btrfs_bio btrfs: Do not use bio-bi_bdev after submission btrfs: Put mirror_num in bi_bdev btrfs: Moved repair code from inode.c to extent_io.c fs/btrfs/extent-tree.c

[RFC PATCH 2/4] btrfs: Do not use bio-bi_bdev after submission

2011-07-22 Thread Jan Schmidt
instead of the leftover in the bio. This gives us the possibility to use the bi_bdev field for another purpose. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/inode.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c

[RFC PATCH 1/4] btrfs: btrfs_multi_bio replaced with btrfs_bio

2011-07-22 Thread Jan Schmidt
btrfs_bio is a bio abstraction able to split and not complete after the last bio has returned (like the old btrfs_multi_bio). Additionally, btrfs_bio tracks the mirror_num used to read data which can be used for error correction purposes. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

[RFC PATCH 3/4] btrfs: Put mirror_num in bi_bdev

2011-07-22 Thread Jan Schmidt
after the bio returned. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/volumes.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e839b72..55fbd4d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c

Re: [PATCH v7 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-24 Thread Jan Schmidt
On 24.07.2011 00:38, Jan Schubert wrote: Jan Schmidt list.btrfs at jan-o-sch.net writes: The first feature adds printk statements in case scrub finds an error which list all affected files. You will need patch 1, 2 and 3 for that. Jan, I tried to apply these patches against official 3.0

Re: [RFC PATCH 4/4] btrfs: Moved repair code from inode.c to extent_io.c

2011-07-24 Thread Jan Schmidt
On 24.07.2011 18:24, Andi Kleen wrote: Jan Schmidt list.bt...@jan-o-sch.net writes: Repair works that way: Whenever a read error occurs and we have more mirrors to try, note the failed mirror, and retry another. If we find a good one, check if we did note a failure earlier and if so, do

Re: [PATCH v6 2/8] btrfs scrub: added unverified_errors

2011-07-25 Thread Jan Schmidt
On 25.07.2011 09:11, Li Zefan wrote: +spin_lock(sdev-stat_lock); +++sdev-stat.read_errors; +spin_unlock(sdev-stat_lock); Normally we write i++ instead of ++i if the return value is ignored. Checkpatch didn't say so, it can't be too wrong. For the next time I can do it the other

Re: [PATCH v7 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-25 Thread Jan Schmidt
On 24.07.2011 22:44, Jan Schubert wrote: On 07/24/2011 03:31 PM, Jan Schmidt wrote: Yes, please check if that error solely depends on the state of your file system (which is what I expect). Please try another scrub while the system is as idle as you get it (also consider daemon processes

Re: [RFC PATCH 4/4] btrfs: Moved repair code from inode.c to extent_io.c

2011-07-25 Thread Jan Schmidt
On 25.07.2011 01:01, Andi Kleen wrote: I wasn't clear enough on that: We only track read errors, here. Ans error correction can only happen on the read path. So if the write attempt fails, we can't go into a loop. Not in a loop, but you trigger more IO errors, which can be nasty if the IO

Re: [RFC PATCH 4/4] btrfs: Moved repair code from inode.c to extent_io.c

2011-07-25 Thread Jan Schmidt
On 25.07.2011 05:58, Ian Kent wrote: On Fri, 2011-07-22 at 16:58 +0200, Jan Schmidt wrote: +static int bio_readpage_error(struct bio *failed_bio, struct page *page, +u64 start, u64 end, int failed_mirror, +struct extent_state *state

Re: [PATCH v7 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-25 Thread Jan Schmidt
On 25.07.2011 14:06, Jan Schubert wrote: On 07/25/2011 10:34 AM, Jan Schmidt wrote: On 24.07.2011 22:44, Jan Schubert wrote: Any chance to resolve the inodes to affected files manualy? That's cumbersome, but you can do it using the information contained in the debug-tree output. But I'd

Re: [PATCH v7 1/8] btrfs: added helper functions to iterate backrefs

2011-07-27 Thread Jan Schmidt
On 27.07.2011 10:06, Li Zefan wrote: + alloc_bytes = max((unsigned long)total_bytes, sizeof(*data)); The return type of sizeof() is unsigned int, so this will cause compile warning. We can use max_t() instead. correct: type of sizeof is size_t (so may or may not be unsigned long)

[PATCH v8 2/8] btrfs scrub: added unverified_errors

2011-07-27 Thread Jan Schmidt
carrying such conspicous events to the administrator should already be around. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

[PATCH v8 5/8] btrfs: add mirror_num to extent_read_full_page

2011-07-27 Thread Jan Schmidt
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/disk-io.c |2 +- fs

[PATCH v8 6/8] btrfs scrub: use int for mirror_num, not u64

2011-07-27 Thread Jan Schmidt
the rest of the code uses int mirror_num, and so should scrub Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 59caf8f..41a0114 100644 --- a/fs/btrfs

[PATCH v8 4/8] btrfs scrub: bugfix: mirror_num off by one

2011-07-27 Thread Jan Schmidt
Fix the mirror_num determination in scrub_stripe. The rest of the scrub code did not use mirror_num for anything important and that error went unnoticed. The nodatasum fixup patch of this set depends on a correct mirror_num. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs

[PATCH v8 7/8] btrfs scrub: add fixup code for errors on nodatasum files

2011-07-27 Thread Jan Schmidt
is expected to clear the newly introduced EXTENT_DAMAGED flag, making scrub report that error as corrected instead of uncorrectable eventually. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/extent_io.h |1 + fs/btrfs/scrub.c | 188

[PATCH v8 8/8] btrfs: new ioctls to do logical-inode and inode-path resolving

2011-07-27 Thread Jan Schmidt
these ioctls make use of the new functions initially added for scrub. they return all inodes belonging to a logical address (BTRFS_IOC_LOGICAL_INO) and all paths belonging to an inode (BTRFS_IOC_INO_PATHS). Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/ioctl.c | 143

[PATCH v8 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-27 Thread Jan Schmidt
ioctl priviledge and input sanity checking (reported by Andi Kleen) Changelog v6-v7: - include everything that was stated to be in v6 Please try it and report errors (or confirm there are none, of course). I can provide a place to pull from if anyone likes. -Jan Jan Schmidt (8): btrfs: added

[PATCH v8 1/8] btrfs: added helper functions to iterate backrefs

2011-07-27 Thread Jan Schmidt
These helper functions iterate back references and call a function for each backref. There is also a function to resolve an inode to a path in the file system. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/Makefile |3 +- fs/btrfs/backref.c | 764

[PATCH v8 3/8] btrfs scrub: print paths of corrupted files

2011-07-27 Thread Jan Schmidt
While scrubbing, we may encounter various errors. Previously, a logical address was printed to the log only. Now, all paths belonging to that address are resolved and printed separately. That should work for hardlinks as well as reflinks. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

Re: [PATCH v8 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-07-28 Thread Jan Schmidt
On 28.07.2011 16:44, Jan Schubert wrote: Jan Schubert Jan.Schubert at GMX.li writes: OK, Patch 1 to 3 did apply and run successfully on 3.0-git8. I've sent Jan some more details about the output of the affected files (which is actually just one quite large one). Hooray: scrub status for

[PATCH v3 0/3] Btrfs-progs: add the first inspect-internal commands

2011-07-28 Thread Jan Schmidt
two new commands to the btrfs utility. These patches are based on Hugo's current integration branch. Please try them out and report bugs here. -Jan Jan Schmidt (3): Btrfs-progs: btrfs-list: split list_subvols Btrfs-progs: added ioctls and commands to resolve inodes and logical addrs

[PATCH v3 3/3] Btrfs-progs: added resolve commands to man page

2011-07-28 Thread Jan Schmidt
Added inspect-internal inode-resolve and inspect-internal logical-resolve to the btrfs(8) man page. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- man/btrfs.8.in | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/man/btrfs.8.in b/man

[PATCH v3 1/3] Btrfs-progs: btrfs-list: split list_subvols

2011-07-28 Thread Jan Schmidt
split list_subvols to separate functions and allow printing only in the containing function. lets us make use of those functions when resolving logical addresses. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- btrfs-list.c | 104

[PATCH v3 2/3] Btrfs-progs: added ioctls and commands to resolve inodes and logical addrs

2011-07-28 Thread Jan Schmidt
two new commands that make use of the new path resolving functions implemented for scrub, doing the resolving in-kernel. the result for both commands is a list of files belonging to that inode / logical address. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- btrfs-list.c | 35

[RFC] btrfs send and receive

2011-08-01 Thread Jan Schmidt
I'd like btrfs to support full featured send and receive in the future. If nobody is currently working on it, I'll grab the send/receive lock. Now that I own the lock, I'm opening several discussions on this topic. If you are in a hurry, it would be great if you could at least read and comment on

Re: [RFC] btrfs send and receive

2011-08-02 Thread Jan Schmidt
On 01.08.2011 20:51, Goffredo Baroncelli wrote: On 08/01/2011 02:22 PM, Jan Schmidt wrote: I furthermore realized that the term subvolume is omitted in favor of the term snapshot. This is because I tend to think of snapshots being read-only (though I very much appreciate

Re: Honest timeline for btrfsck

2011-08-03 Thread Jan Schmidt
On 03.08.2011 08:57, Erik Jensen wrote: Had I known back in November 9 months would go by with no such tool, I would have certainly wiped the array and started over, as it was certainly not worth the wait. So here I am, several assurances of imminent release later, still wondering whether it

Re: [RFC] btrfs send and receive

2011-08-03 Thread Jan Schmidt
On 02.08.2011 19:42, Goffredo Baroncelli wrote: Furthermore, receiving should not need kernel support at all (except for an optional interface to create a file with a certain inode, we'll see). Thus, replicating metadata corruptions should be very unlikely. I think that for receiving we can

[GIT PULL] Btrfs patches for scrub, backref walking and raid repair

2011-08-04 Thread Jan Schmidt
is in the commit message). Thanks, -Jan Jan Schmidt (13): btrfs: added helper functions to iterate backrefs btrfs scrub: added unverified_errors btrfs scrub: print paths of corrupted files btrfs scrub: bugfix: mirror_num off by one btrfs: add mirror_num to extent_read_full_page btrfs scrub

Re: [RFC] btrfs send and receive

2011-08-05 Thread Jan Schmidt
On 02.08.2011 18:01, Jan Schmidt wrote: On 02.08.2011 17:21, Chris Mason wrote: But, I'll toss in an alternative. Adapt the git pack files a little and use them as the format. There are a few reasons for this: Git has a very strong developer community and is already being hammered into use

Re: Getting a lot of fs-generated information to user space

2011-08-12 Thread Jan Schmidt
On 12.08.2011 14:31, Matthew Wilcox wrote: On Fri, Aug 12, 2011 at 02:14:15PM +0200, Jan Schmidt wrote: (1) Normally, requests to the file system go through ioctls (on the fd of the mountpoint) and the result is small enough to be returned when the ioctl finishes. That said, I thought

Re: Getting a lot of fs-generated information to user space

2011-08-12 Thread Jan Schmidt
On 12.08.2011 14:31, Matthew Wilcox wrote: On Fri, Aug 12, 2011 at 02:14:15PM +0200, Jan Schmidt wrote: (1) Normally, requests to the file system go through ioctls (on the fd of the mountpoint) and the result is small enough to be returned when the ioctl finishes. That said, I thought

[PATCH v4 0/3] Btrfs-progs: add the first inspect-internal commands

2011-09-01 Thread Jan Schmidt
. Please try them out and report bugs here. -Jan Jan Schmidt (3): Btrfs-progs: btrfs-list: split list_subvols Btrfs-progs: added ioctls and commands to resolve inodes and logical addrs Btrfs-progs: added resolve commands to man page btrfs-list.c | 138

[PATCH v4 3/3] Btrfs-progs: added resolve commands to man page

2011-09-01 Thread Jan Schmidt
Added inspect-internal inode-resolve and inspect-internal logical-resolve to the btrfs(8) man page. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- man/btrfs.8.in | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/man/btrfs.8.in b/man

[PATCH v4 1/3] Btrfs-progs: btrfs-list: split list_subvols

2011-09-01 Thread Jan Schmidt
split list_subvols to separate functions and allow printing only in the containing function. lets us make use of those functions when resolving logical addresses. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- btrfs-list.c | 103

[PATCH v4 2/3] Btrfs-progs: added ioctls and commands to resolve inodes and logical addrs

2011-09-01 Thread Jan Schmidt
two new commands that make use of the new path resolving functions implemented for scrub, doing the resolving in-kernel. the result for both commands is a list of files belonging to that inode / logical address. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- btrfs-list.c | 35

[PATCH v9 2/8] btrfs scrub: added unverified_errors

2011-09-01 Thread Jan Schmidt
carrying such conspicous events to the administrator should already be around. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

[PATCH v9 8/8] btrfs: new ioctls to do logical-inode and inode-path resolving

2011-09-01 Thread Jan Schmidt
these ioctls make use of the new functions initially added for scrub. they return all inodes belonging to a logical address (BTRFS_IOC_LOGICAL_INO) and all paths belonging to an inode (BTRFS_IOC_INO_PATHS). Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/ioctl.c | 143

[PATCH v9 5/8] btrfs: add mirror_num to extent_read_full_page

2011-09-01 Thread Jan Schmidt
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/disk-io.c |2 +- fs

[PATCH v9 1/8] btrfs: added helper functions to iterate backrefs

2011-09-01 Thread Jan Schmidt
These helper functions iterate back references and call a function for each backref. There is also a function to resolve an inode to a path in the file system. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/Makefile |3 +- fs/btrfs/backref.c | 776

[PATCH v9 7/8] btrfs scrub: add fixup code for errors on nodatasum files

2011-09-01 Thread Jan Schmidt
is expected to clear the newly introduced EXTENT_DAMAGED flag, making scrub report that error as corrected instead of uncorrectable eventually. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/extent_io.h |1 + fs/btrfs/scrub.c | 188

[PATCH v9 3/8] btrfs scrub: print paths of corrupted files

2011-09-01 Thread Jan Schmidt
While scrubbing, we may encounter various errors. Previously, a logical address was printed to the log only. Now, all paths belonging to that address are resolved and printed separately. That should work for hardlinks as well as reflinks. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net

[PATCH v9 6/8] btrfs scrub: use int for mirror_num, not u64

2011-09-01 Thread Jan Schmidt
the rest of the code uses int mirror_num, and so should scrub Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/scrub.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 59caf8f..41a0114 100644 --- a/fs/btrfs

[PATCH v9 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup

2011-09-01 Thread Jan Schmidt
(or confirm there are none, of course). I can provide a place to pull from if anyone likes. -Jan Jan Schmidt (8): btrfs: added helper functions to iterate backrefs btrfs scrub: added unverified_errors btrfs scrub: print paths of corrupted files btrfs scrub: bugfix: mirror_num off by one

Broken DIR_ITEMs on snapshot

2011-10-18 Thread Jan Schmidt
Hi, while still busy with btrfs send, I came across some strange DIR_ITEMs. I looked into that briefly, but I'd rather return to implementing btrfs send, hoping someone is willing to make up his mind on this one :-) To reproduce, do the following: # mkfs.btrfs /dev/sdv2 # mount /dev/sdv2 /mnt #

Creation of pseudo items leads to (seemingly) duplicate inodes (BUG inside)

2011-10-18 Thread Jan Schmidt
Hi there, while playing with snapshots for btrfs send, I also encountered seemingly duplicate inodes, which are multiple BTRFS_EMPTY_SUBVOL_DIR_OBJECTID objects within the same directory. I can imagine software that feels uncomfortable, here. Such objects are created by btrfs_lookup_dentry() in

Re: Creation of pseudo items leads to (seemingly) duplicate inodes (BUG inside)

2011-10-19 Thread Jan Schmidt
On 19.10.2011 03:18, Liu Bo wrote: On 10/19/2011 09:01 AM, Liu Bo wrote: On 10/19/2011 12:02 AM, Jan Schmidt wrote: Hi there, while playing with snapshots for btrfs send, I also encountered seemingly duplicate inodes, which are multiple BTRFS_EMPTY_SUBVOL_DIR_OBJECTID objects within

Re: Creation of pseudo items leads to (seemingly) duplicate inodes (BUG inside)

2011-10-19 Thread Jan Schmidt
On 18.10.2011 21:04, Ilya Dryomov wrote: On Tue, Oct 18, 2011 at 06:02:09PM +0200, Jan Schmidt wrote: Reproducer for the curious: # mkfs.btrfs /dev/sdv2 # mount /dev/sdv2 /mnt # btrfs subvol snap /mnt /mnt/snap1 # btrfs subvol snap /mnt /mnt/snap2 # btrfs subvol snap /mnt /mnt/snap3 When

Re: Broken DIR_ITEMs on snapshot

2011-10-19 Thread Jan Schmidt
On 18.10.2011 20:51, Ilya Dryomov wrote: On Tue, Oct 18, 2011 at 06:01:11PM +0200, Jan Schmidt wrote: Hi, while still busy with btrfs send, I came across some strange DIR_ITEMs. I looked into that briefly, but I'd rather return to implementing btrfs send, hoping someone is willing to make up

Re: How to know the origin of a snapshot

2011-10-21 Thread Jan Schmidt
Hi, On 21.10.2011 13:02, Ryota Ozaki wrote: Is there a way to know relations between subvolume and snapshot? For example, can we know a subvolume from a given snapshot which stems from it? For another example, can we get a list of snapshots from a subvolume? Currently, there's no such

Re: Subvolume level allocation policy

2011-10-24 Thread Jan Schmidt
On 23.10.2011 20:50, Phillip Susi wrote: Is it ( yet? ) possible to manipulate the allocation policy on a subvolume level instead of the fs level? For example, to make / use raid1, and /home use raid0? Or to have / allocated from an ssd and /home allocated from the giant 2tb hd. At least

Re: [PATCH v8 1/8] btrfs: added helper functions to iterate backrefs

2011-11-03 Thread Jan Schmidt
On 03.11.2011 02:41, Li Zefan wrote: (as this is going to be merged into mainline..) +/* + * calls iterate() for every inode that references the extent identified by + * the given parameters. will use the path given as a parameter and return it + * released. + * when the iterator

Re: [btrfs-progs: PATCH] scrub: fix build failure by restoring proper library ordering

2011-11-07 Thread Jan Schmidt
Hi David, On 07.11.2011 13:45, David Sterba wrote: On Mon, Nov 07, 2011 at 10:19:33AM +0300, sly...@gmail.com wrote: btrfs: $(objects) btrfs.o btrfs_cmds.o scrub.o -$(CC) -lpthread $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o scrub.o \ -$(objects) $(LDFLAGS) $(LIBS) +$(CC)

Re: [GIT PULL] Btrfs pull request

2011-11-09 Thread Jan Schmidt
Am 09.11.2011 08:48, schrieb Christoph Hellwig: On Tue, Nov 08, 2011 at 08:07:01PM -0500, Chris Mason wrote: Looks like bio_add_page() is failing and we're getting the enomem from there. LVM is only letting us put one page in each bio. Yes, at the moment all bio based DM targets only allow

Re: [GIT PULL] Btrfs pull request

2011-11-09 Thread Jan Schmidt
On 09.11.2011 11:29, Jan Schmidt wrote: grep bio_add_page fs/btrfs/*.c will make you unhappy. Phew. Actually, not that unhappy. Many of the lines seeming to have no return value check are in fact part of a long or-ed if-statement. Seems okay after a closer look. -Jan -- To unsubscribe from

Re: [PATCH] Btrfs-progs: Relocate -lpthread in makefile

2011-11-14 Thread Jan Schmidt
Hannemann a...@arndnet.de Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net Sergei also sent this patch a week ago. I agree with you. David, do you want to investigate the -pthread option? -Jan -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message

<    1   2   3   4   5   6   >