Re: [PATCH 2/4] Btrfs: fix data corruption in raid6

2017-11-08 Thread Liu Bo
On Tue, Nov 07, 2017 at 04:32:55PM +0800, Anand Jain wrote: > > > On 11/02/2017 08:54 AM, Liu Bo wrote: > >With raid6 profile, btrfs can end up with data corruption by the > >following steps. > > > >Say we have a 5 disks that are set up with raid6 profile, > > > >1) mount this btrfs > >2) one

Re: [PATCH 1/4] Btrfs: introduce device flags

2017-11-08 Thread Liu Bo
On Mon, Nov 06, 2017 at 05:40:25PM +0100, David Sterba wrote: > On Wed, Nov 01, 2017 at 06:54:02PM -0600, Liu Bo wrote: > > Here we have defined two flags, > > - Fautly > > - In_sync > > > > Currently only In_sync is in use, it only matters when device serves > > as part of a raid profile. The

Re: Problem with file system

2017-11-08 Thread Austin S. Hemmelgarn
On 2017-11-08 13:31, Chris Murphy wrote: On Wed, Nov 8, 2017 at 11:10 AM, Austin S. Hemmelgarn wrote: On 2017-11-08 12:54, Chris Murphy wrote: On Wed, Nov 8, 2017 at 10:22 AM, Hugo Mills wrote: On Wed, Nov 08, 2017 at 10:17:28AM -0700, Chris

Re: Problem with file system

2017-11-08 Thread Chris Murphy
On Wed, Nov 8, 2017 at 11:10 AM, Austin S. Hemmelgarn wrote: > On 2017-11-08 12:54, Chris Murphy wrote: >> >> On Wed, Nov 8, 2017 at 10:22 AM, Hugo Mills wrote: >>> >>> On Wed, Nov 08, 2017 at 10:17:28AM -0700, Chris Murphy wrote: On Wed, Nov

Re: Problem with file system

2017-11-08 Thread Austin S. Hemmelgarn
On 2017-11-08 12:54, Chris Murphy wrote: On Wed, Nov 8, 2017 at 10:22 AM, Hugo Mills wrote: On Wed, Nov 08, 2017 at 10:17:28AM -0700, Chris Murphy wrote: On Wed, Nov 8, 2017 at 5:13 AM, Austin S. Hemmelgarn wrote: It definitely does fix ups during

Re: Problem with file system

2017-11-08 Thread Chris Murphy
On Wed, Nov 8, 2017 at 10:22 AM, Hugo Mills wrote: > On Wed, Nov 08, 2017 at 10:17:28AM -0700, Chris Murphy wrote: >> On Wed, Nov 8, 2017 at 5:13 AM, Austin S. Hemmelgarn >> wrote: >> >> >> It definitely does fix ups during normal operations. During

Re: Problem with file system

2017-11-08 Thread Hugo Mills
On Wed, Nov 08, 2017 at 10:17:28AM -0700, Chris Murphy wrote: > On Wed, Nov 8, 2017 at 5:13 AM, Austin S. Hemmelgarn > wrote: > > >> It definitely does fix ups during normal operations. During reads, if > >> there's a UNC or there's corruption detected, Btrfs gets the good

Re: Problem with file system

2017-11-08 Thread Chris Murphy
On Wed, Nov 8, 2017 at 5:13 AM, Austin S. Hemmelgarn wrote: >> It definitely does fix ups during normal operations. During reads, if >> there's a UNC or there's corruption detected, Btrfs gets the good >> copy, and does a (I think it's an overwrite, not COW) fixup. Fixups

Re: [PATCH] Btrfs: document rules about bio async submit

2017-11-08 Thread David Sterba
On Wed, Nov 01, 2017 at 05:19:27PM -0600, Liu Bo wrote: > These rules have been hidden in several if-else and are not > straightforward to follow, for example, dio submit hook's nocsum case > has a bug , i.e. doing async submit instead of sync submit, which has > been fixed recently. > > This is

Re: Problem with file system

2017-11-08 Thread Austin S. Hemmelgarn
On 2017-11-07 23:50, Chris Murphy wrote: On Tue, Nov 7, 2017 at 6:02 AM, Austin S. Hemmelgarn wrote: * Optional automatic correction of errors detected during normal usage. Right now, you have to run a scrub to correct errors. Such a design makes sense with MD and LVM,

Re: [PATCH v2 2/3] btrfs: tree-checker: Add checker for dir item

2017-11-08 Thread Qu Wenruo
On 2017年11月08日 15:59, Nikolay Borisov wrote: > > > On 8.11.2017 02:54, Qu Wenruo wrote: >> Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and >> XATTR_ITEM. >> >> This checker does comprehensive check for: >> 1) dir_item header and its data size >>Against item boundary and

Re: [PATCH v2 1/3] btrfs: tree-checker: Fix false panic for sanity test

2017-11-08 Thread Qu Wenruo
On 2017年11月08日 15:55, Nikolay Borisov wrote: > > > On 8.11.2017 02:54, Qu Wenruo wrote: >> [BUG] >> If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will >> instantly cause kernel panic like: >> >> -- >> ... >> assertion failed: 0, file: fs/btrfs/disk-io.c, line: 3853 >> ... >>

Re: [PATCH v2 2/3] btrfs: tree-checker: Add checker for dir item

2017-11-08 Thread Nikolay Borisov
On 8.11.2017 02:54, Qu Wenruo wrote: > Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and > XATTR_ITEM. > > This checker does comprehensive check for: > 1) dir_item header and its data size >Against item boundary and maximum name/xattr length. >This part is mostly the same