[PATCH 2/2] btrfs: scrub: Remove unused copy_nocow_pages() and its children functions

2018-06-05 Thread Qu Wenruo
Entrance function copy_nocow_pages() is no longer used, and remove all its children functions, since they can't handle compressed nodatasum extent properly and in fact the "optimization" is pretty niche, using the unified scrub_pages() would be a much better idea. Signed-off-by: Qu Wenruo ---

[PATCH 1/2] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread Qu Wenruo
[BUG] Btrfs can easily create compressed extent without checksum (even though it shouldn't), and if we then try to replace device containing such extent, the result device will contain all the uncompressed data instead of the compressed one. Test case already submitted to fstests:

Re: off-by-one uncompressed invalid ram_bytes corruptions

2018-06-05 Thread Steve Leung
On 06/04/2018 11:30 PM, Qu Wenruo wrote: On 2018年05月29日 22:58, Steve Leung wrote: Qu Wenruo writes: On 2018年05月28日 11:47, Steve Leung wrote: On 05/26/2018 06:57 PM, Qu Wenruo wrote: [snip] Still nope. What about encrypt it and upload it to some public storage provider like google

[PATCH v2] btrfs-progs: device: Added verbose option to scan

2018-06-05 Thread james harvey
Only works when device(s) not specified. At verbose level 1, for each registered btrfs filesystem, compactly show fs uuid, and for each of its devices, the device id, name, and uuid. At verbose level 2, show everything for the fs and its devices. Previous behavior of print_all_devices(), which

Re: [PATCH] btrfs-progs: device: Added verbose option to scan

2018-06-05 Thread james harvey
On Tue, Jun 5, 2018 at 10:52 PM, james harvey wrote: > Only works when device(s) not specified. > ... Pretend the original email subject was: [PATCH] btrfs-progs: device: Added verbose option to scan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a

[PATCH] Added verbose option to btrfs device scan

2018-06-05 Thread james harvey
Only works when device(s) not specified. At verbose level 1, for each registered btrfs filesystem, compactly show fs uuid, and for each of its devices, the device id, name, and uuid. At verbose level 2, show everything for the fs and its devices. Previous behavior of print_all_devices(), which

Re: [PATCH] btrfs-progs: check: Fix wrong error message in case of corrupted extent

2018-06-05 Thread Su Yue
On 06/05/2018 07:39 PM, Nikolay Borisov wrote: > When btrfs check detects a freespace tree extent which ends beyond the > blockgroup containing it a misleading error messages is printed. For > example if we have the following extent in the freespace tree: > > item 5 key (30408704

Re: [Bug 199931] New: systemd/rtorrent file data corruption when using echo 3 >/proc/sys/vm/drop_caches

2018-06-05 Thread Chris Mason
On 5 Jun 2018, at 16:03, Andrew Morton wrote: (switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Tue, 05 Jun 2018 18:01:36 + bugzilla-dae...@bugzilla.kernel.org wrote: https://bugzilla.kernel.org/show_bug.cgi?id=199931

Re: [Bug 199931] New: systemd/rtorrent file data corruption when using echo 3 >/proc/sys/vm/drop_caches

2018-06-05 Thread james harvey
On Tue, Jun 5, 2018 at 4:03 PM, Andrew Morton wrote: > On Tue, 05 Jun 2018 18:01:36 + bugzilla-dae...@bugzilla.kernel.org wrote: > >> https://bugzilla.kernel.org/show_bug.cgi?id=199931 >> >> Bug ID: 199931 >>Summary: systemd/rtorrent file data corruption when using

Re: [Bug 199931] New: systemd/rtorrent file data corruption when using echo 3 >/proc/sys/vm/drop_caches

2018-06-05 Thread Andrew Morton
On Wed, 6 Jun 2018 06:22:25 +0900 Tetsuo Handa wrote: > On 2018/06/06 5:03, Andrew Morton wrote: > > > > (switched to email. Please respond via emailed reply-to-all, not via the > > bugzilla web interface). > > > > On Tue, 05 Jun 2018 18:01:36 + bugzilla-dae...@bugzilla.kernel.org > >

Re: [Bug 199931] New: systemd/rtorrent file data corruption when using echo 3 >/proc/sys/vm/drop_caches

2018-06-05 Thread Tetsuo Handa
On 2018/06/06 5:03, Andrew Morton wrote: > > (switched to email. Please respond via emailed reply-to-all, not via the > bugzilla web interface). > > On Tue, 05 Jun 2018 18:01:36 + bugzilla-dae...@bugzilla.kernel.org wrote: > >> https://bugzilla.kernel.org/show_bug.cgi?id=199931 >> >>

Re: [Bug 199931] New: systemd/rtorrent file data corruption when using echo 3 >/proc/sys/vm/drop_caches

2018-06-05 Thread Andrew Morton
(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Tue, 05 Jun 2018 18:01:36 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=199931 > > Bug ID: 199931 >Summary:

Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread Nikolay Borisov
On 5.06.2018 17:24, David Sterba wrote: > On Tue, Jun 05, 2018 at 10:14:51PM +0800, Qu Wenruo wrote: The previous version (a completely different direction though) is much smaller. https://patchwork.kernel.org/patch/10440541/ However personally speaking, I still prefer

Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread David Sterba
On Tue, Jun 05, 2018 at 10:14:51PM +0800, Qu Wenruo wrote: > >> The previous version (a completely different direction though) is much > >> smaller. > >> https://patchwork.kernel.org/patch/10440541/ > >> > >> However personally speaking, I still prefer this one, as it's much simpler. > > > > As

Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread Qu Wenruo
On 2018年06月05日 22:07, David Sterba wrote: > On Tue, Jun 05, 2018 at 09:47:46PM +0800, Qu Wenruo wrote: >> >> >> On 2018年06月05日 21:42, David Sterba wrote: >>> On Tue, Jun 05, 2018 at 01:34:03PM +0800, Qu Wenruo wrote: Hi David, It would be pretty nice if we could get this fix (or

Re: [PATCH] btrfs: Check error of btrfs_iget() in btrfs_search_path_in_tree_user()

2018-06-05 Thread David Sterba
On Mon, Jun 04, 2018 at 04:41:07PM +0900, Misono Tomohiro wrote: > Signed-off-by: Misono Tomohiro > --- > > Hi david, > > It seems that v8 patch I sent last week is missed and commit in misc-next > tree is also a bit updated from v7, so I resend the fix as a separate patch. > > Please fold

Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread David Sterba
On Tue, Jun 05, 2018 at 09:47:46PM +0800, Qu Wenruo wrote: > > > On 2018年06月05日 21:42, David Sterba wrote: > > On Tue, Jun 05, 2018 at 01:34:03PM +0800, Qu Wenruo wrote: > >> Hi David, > >> > >> It would be pretty nice if we could get this fix (or previous RFC patch) > >> to get into current

Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread Qu Wenruo
On 2018年06月05日 21:42, David Sterba wrote: > On Tue, Jun 05, 2018 at 01:34:03PM +0800, Qu Wenruo wrote: >> Hi David, >> >> It would be pretty nice if we could get this fix (or previous RFC patch) >> to get into current release cycle. >> >> As it's a unrecoverable data corruption, it would be

Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace

2018-06-05 Thread David Sterba
On Tue, Jun 05, 2018 at 01:34:03PM +0800, Qu Wenruo wrote: > Hi David, > > It would be pretty nice if we could get this fix (or previous RFC patch) > to get into current release cycle. > > As it's a unrecoverable data corruption, it would be better to get it > fixed as soon as possible. That we

Re: [PATCH] fstests: btrfs: Test if btrfs will corrupt nodatasum compressed extent when replacing device

2018-06-05 Thread Qu Wenruo
On 2018年06月05日 18:42, Anand Jain wrote: > > > On 06/01/2018 09:34 AM, Qu Wenruo wrote: >> This is a long existing bug (from 2012) but exposed by a reporter >> recently, that when compressed extent without data csum get written to >> device-replace target device, the written data is in fact

[PATCH] btrfs-progs: check: Fix wrong error message in case of corrupted extent

2018-06-05 Thread Nikolay Borisov
When btrfs check detects a freespace tree extent which ends beyond the blockgroup containing it a misleading error messages is printed. For example if we have the following extent in the freespace tree: item 5 key (30408704 FREE_SPACE_INFO 1073741824) itemoff 16259 itemsize 8 free

Re: [PATCH] fstests: btrfs: Test if btrfs will corrupt nodatasum compressed extent when replacing device

2018-06-05 Thread Anand Jain
On 06/01/2018 09:34 AM, Qu Wenruo wrote: This is a long existing bug (from 2012) but exposed by a reporter recently, that when compressed extent without data csum get written to device-replace target device, the written data is in fact uncompressed data other than the original compressed