[PATCH RFC v6 6/9] vfs: Add sb_want_write() function to get vfsmount from a given sb.

2015-02-03 Thread Qu Wenruo
*** Please DON'T merge this patch, it's only for disscusion purpose *** There are sysfs interfaces in some fs, only btrfs yet, which will modify on-disk data. Unlike normal file operation routine we can use mnt_want_write_file() to protect the operation, change through sysfs won't to be binded to

Re: [PATCH RFC v6 6/9] vfs: Add sb_want_write() function to get vfsmount from a given sb.

2015-02-03 Thread Qu Wenruo
Add Cc: v...@zeniv.linux.org.uk Original Message Subject: [PATCH RFC v6 6/9] vfs: Add sb_want_write() function to get vfsmount from a given sb. From: Qu Wenruo quwen...@cn.fujitsu.com To: linux-btrfs@vger.kernel.org Date: 2015年02月04日 10:10 *** Please DON'T merge this patch,

[PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode.

2015-02-03 Thread Qu Wenruo
Btrfs's metadata csum is a good mechanism, keeping bit error away from sensitive kernel. But such mechanism will also be too sensitive, like bit error in csum bytes or low all zero bits in nodeptr. It's a trade using error tolerance for stable, and is reasonable for most cases since there is

Re: [PATCH] Btrfs: fix find_free_dev_extent() malfunction in case device tree has hole

2015-02-03 Thread Liu Bo
On Mon, Feb 02, 2015 at 03:31:39PM +0800, Forrest Liu wrote: If device tree has hole, find_free_dev_extent() cannot find available address properly. The example below, has one BIG hole in device tree, and can only allocate just one chunk in a transaction. item 9 key (1 DEV_EXTENT

paused balance convert from raid1 can no longer be a writeable mount

2015-02-03 Thread Chris Murphy
Problem occurs with 3.19.0-0.rc7.git0.1.fc22.x86_64, no regression testing or attempt to reproduce has been done yet. But the file system isn't particularly old. Steps 1-6 occur with kernel 3.16 through 3.19 with no errors. 1. mkfs.btrfs -draid1 -mraid1 /dev/sd[bc] ## btrfs-progs ~3.16 or 3.17

[PATCH 7/7] btrfs-progs: Introduce --dangerous option to reset all tree block csum.

2015-02-03 Thread Qu Wenruo
Sometimes minor bit error is repairable without much pain, like bit error in tree root csum. But in that case, if metadata profile is single it is unable to mount nor btrfsck can repair it. So add '--dangerous' option to reset all tree block csum. NOTE: in most case, bit error can cause

[PATCH 6/7] btrfs-progs: Introduce new function reset_(one_root/roots)_csum() to reset one/all tree's csum in tree root.

2015-02-03 Thread Qu Wenruo
New function reset_one_root_csum() will reset all csum in one root. And reset_roots_csum() will reset all csum of all trees in tree root. which provides the basis for later dangerous options. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- cmds-check.c | 176

[PATCH 5/7] btrfs-progs: Introduce new function reset_tree_block_csum() for later tree block csum reset.

2015-02-03 Thread Qu Wenruo
New function reset_tree_block_csum() will do the black magic to reset csum for a tree block in-place. This provides the basis to the whole tree csum resetting function. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- cmds-check.c | 56

[PATCH 4/5] btrfs-progs: Introduce new function reset_tree_block_csum() for later tree block csum reset.

2015-02-03 Thread Qu Wenruo
New function reset_tree_block_csum() will do the black magic to reset csum for a tree block in-place. This provides the basis to the whole tree csum resetting function. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- cmds-check.c | 56

[PATCH 5/5] btrfs-progs: Introduce new function reset_(one_root/roots)_csum() to reset one/all tree's csum in tree root.

2015-02-03 Thread Qu Wenruo
New function reset_one_root_csum() will reset all csum in one root. And reset_roots_csum() will reset all csum of all trees in tree root. which provides the basis for later dangerous options. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- cmds-check.c | 157

[PATCH 1/7] btrfs-progs: Add btrfs_(prev/next)_tree_block() to keep search result in the same level of path-lowest_level.

2015-02-03 Thread Qu Wenruo
Before this patch, btrfs_(prev/next)_leaf() will search for the leaf even path-lowest_level is set. This is OK since nobody needs such function. But later patches to clean up the csum in tree block needs to iterate tree blocks level by level, which such function will be very handy. This patch

[PATCH 4/7] btrfs-progs: Export write_tree_block() and allow it to do nocow write.

2015-02-03 Thread Qu Wenruo
Export write_tree_block() function, and allow it to write data to disk without transaction. This is useful for resetting tree block csum, where the reset is done level by level, so btrfs_search_slot() is doing lowest_level search and can't do cow (cow with lowest_level will screw up extent

[PATCH 3/7] btrfs-progs: Allow btrfs_read_fs_root() to re-read the tree node.

2015-02-03 Thread Qu Wenruo
With this patch, btrfs_read_fs_root() will try to re-read the tree node if it's not up to date. This will help for the tree block csum resetting function. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- disk-io.c | 51 +++ 1 file changed, 39

[PATCH 2/7] btrfs-progs: Introduce btrfs_next_slot() function to iterate to next slot in given level.

2015-02-03 Thread Qu Wenruo
This will help a lot in level by level iteration. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- ctree.h | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ctree.h b/ctree.h index c52d3de..0dfe733 100644 --- a/ctree.h +++ b/ctree.h @@ -2340,13 +2340,18 @@

Re: how to repair a damaged filesystem with btrfs raid5

2015-02-03 Thread Alexander Fieroch
Am 03.02.2015 um 01:24 schrieb Tobias Holst: Hi. Hi, There is a known bug when you re-plug in a missing hdd of a btrfs raid without wiping the device before. In worst case this results in a totally corrupted filesystem as it did sometimes during my tests of the raid6 implementation. With

Re: [PATCH] Btrfs: fix find_free_dev_extent() malfunction in case device tree has hole

2015-02-03 Thread Forrest Liu
2015-02-03 2:40 GMT+08:00 Ed Tomlinson e...@aei.ca: On Monday, February 2, 2015 9:39:06 AM EST, Ed Tomlinson wrote: Hi Booting a kernel with the three patches: [PATCH] Btrfs: fix find_free_dev_extent() malfunction in case device tree has hole [PATCH] Btrfs:

Btrfs-progs 3.19rc1 issues

2015-02-03 Thread WorMzy Tykashi
Hi David, I've been watching the 3.19.x branch with interest, and noticed that you've tagged rc1. Unfortunately, I think I've found a few problems with it. I will try to explain here: For the record, I'm building using devtools (a set of clean chroot build scripts) on an up-to-date Arch Linux

Re: [PATCH] Btrfs: fix find_free_dev_extent() malfunction in case device tree has hole

2015-02-03 Thread Ed Tomlinson
Hi, Its a great idea to test the patches before submitting. However I think its even more importent to tell us the state of testing. eg. this is an RFC or in production in abc's kernel, and this version is untested or has been compile tested, boot tested, improves xfstests (before x

[PATCH] Btrfs: use asynchronous submit for large DIO io in single profile

2015-02-03 Thread Liu Bo
Commit 1ae399382512 (Btrfs: do not use async submit for small DIO io's) benefits small DIO io's. However, if we're owning the SINGLE profile, this also affects large DIO io's since in that case, map_length is (chunk_length - bio's offset_in_chunk), it's farily large so that it's very likely to be

Re: [PATCH] Btrfs: use asynchronous submit for large DIO io in single profile

2015-02-03 Thread Liu Bo
Sorry, this is only btrfs concerned, I made a typo in email address. Thanks, -liubo On Tue, Feb 03, 2015 at 06:45:38PM +0800, Liu Bo wrote: Commit 1ae399382512 (Btrfs: do not use async submit for small DIO io's) benefits small DIO io's. However, if we're owning the SINGLE profile, this

single GlobalReserve

2015-02-03 Thread Russell Coker
# btrfs fi df /big Data, RAID1: total=2.56TiB, used=2.56TiB System, RAID1: total=32.00MiB, used=388.00KiB Metadata, RAID1: total=19.25GiB, used=14.06GiB GlobalReserve, single: total=512.00MiB, used=0.00B Why is GlobalReserve single? That filesystem has been RAID-1 for ages (since long before

Re: Btrfs-progs 3.19rc1 issues

2015-02-03 Thread Qu Wenruo
Original Message Subject: Btrfs-progs 3.19rc1 issues From: WorMzy Tykashi wormzy.tyka...@gmail.com To: linux-btrfs@vger.kernel.org linux-btrfs@vger.kernel.org, David Sterba dste...@suse.cz Date: 2015年02月04日 06:26 Hi David, I've been watching the 3.19.x branch with interest,