Re: [PATCH RFC] btrfs: fix read corrpution from disks of different generation

2019-03-20 Thread Anand Jain
On 3/20/19 11:40 PM, Zygo Blaxell wrote: On Wed, Mar 20, 2019 at 10:40:07PM +0800, Qu Wenruo wrote: On 2019/3/20 下午10:00, Anand Jain wrote:   Also any idea why the generation number for the extent data is not   incremented [2] when -o nodatacow and notrunc option is used, is it   a bu

[PATCH] btrfs: Use raw numbers when setting passing uptodate parameter to btrfs_writepage_endio_finish_ordered

2019-03-20 Thread Nikolay Borisov
The uptodate parameter of btrfs_writepage_endio_finish_ordered is used to signal whether an error has occured while writing the given page. 0 signal an error, which is propagated to callees and 1 signifies success. In end_compressed_bio_write the ->bi_status is checked and based on it either BLK_ST

Re: [PATCH v5.3 03/11] btrfs: extent_io: Move the BUG_ON() in flush_write_bio() one level up

2019-03-20 Thread David Sterba
On Wed, Mar 20, 2019 at 02:27:41PM +0800, Qu Wenruo wrote: > We have a BUG_ON() in flush_write_bio() to handle the return value of > submit_one_bio(). > > Move the BUG_ON() one level up to all its callers. > > This patch will introduce temporary variable, @flush_ret to keep code > change minimal

Re: [PATCH RFC] btrfs: fix read corrpution from disks of different generation

2019-03-20 Thread Zygo Blaxell
On Wed, Mar 20, 2019 at 09:54:16PM +0800, Anand Jain wrote: > > > On 3/20/19 2:27 PM, Qu Wenruo wrote: > > > > > > On 2019/3/20 下午1:47, Anand Jain wrote: > > > > > > > > > > > > > A tree based integrity verification > > > > > > >    is important for all data, which is missing. > > > > > > >

Re: [PATCH RFC] btrfs: fix read corrpution from disks of different generation

2019-03-20 Thread Zygo Blaxell
On Wed, Mar 20, 2019 at 10:40:07PM +0800, Qu Wenruo wrote: > > > On 2019/3/20 下午10:00, Anand Jain wrote: > > > >>>   Also any idea why the generation number for the extent data is not > >>>   incremented [2] when -o nodatacow and notrunc option is used, is it > >>>   a bug? the dump-tree is take

Re: [PATCH RFC] btrfs: fix read corrpution from disks of different generation

2019-03-20 Thread Qu Wenruo
On 2019/3/20 下午10:00, Anand Jain wrote: > >>>   Also any idea why the generation number for the extent data is not >>>   incremented [2] when -o nodatacow and notrunc option is used, is it >>>   a bug? the dump-tree is taken with the script as below [1] >>>   (this corruption is seen with or wit

Re: [PATCH RFC] btrfs: fix read corrpution from disks of different generation

2019-03-20 Thread Anand Jain
 Also any idea why the generation number for the extent data is not  incremented [2] when -o nodatacow and notrunc option is used, is it  a bug? the dump-tree is taken with the script as below [1]  (this corruption is seen with or without generation number is  being incremented, but as ano

Re: [PATCH RFC] btrfs: fix read corrpution from disks of different generation

2019-03-20 Thread Anand Jain
On 3/20/19 2:27 PM, Qu Wenruo wrote: On 2019/3/20 下午1:47, Anand Jain wrote: A tree based integrity verification    is important for all data, which is missing.      Fix: In this RFC patch it proposes to use same disk from with the metadata    is read to read the data. The obvi

Re: [PATCh v2 9/9] btrfs: inode: Verify inode mode to avoid NULL pointer dereference

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCh v2 8/9] btrfs: tree-checker: Verify inode item

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn Although I prefer direct returns instead of gotos if there's no cleanup. -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N

Re: [PATCh v2 7/9] btrfs: tree-checker: Enhance chunk checker to validate chunk profiler

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCh v2 6/9] btrfs: Check the first key and level for cached extent buffer

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCh v2 5/9] btrfs: tree-checker: Verify dev item

2019-03-20 Thread Qu Wenruo
On 2019/3/20 下午7:51, Johannes Thumshirn wrote: > On 20/03/2019 07:37, Qu Wenruo wrote: > [...] > >> +static int check_dev_item(struct btrfs_fs_info *fs_info, >> + struct extent_buffer *leaf, >> + struct btrfs_key *key, int slot) >> +{ >> +struct btr

Re: [PATCh v2 5/9] btrfs: tree-checker: Verify dev item

2019-03-20 Thread Johannes Thumshirn
On 20/03/2019 07:37, Qu Wenruo wrote: [...] > +static int check_dev_item(struct btrfs_fs_info *fs_info, > + struct extent_buffer *leaf, > + struct btrfs_key *key, int slot) > +{ > + struct btrfs_dev_item *ditem; > + u64 max_devid = max(BTRFS_MAX_

Re: [PATCh v2 4/9] btrfs: tree-checker: Check chunk item at tree block read time

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCh v2 3/9] btrfs: tree-checker: Make btrfs_check_chunk_valid() return EUCLEAN instead of EIO

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCh v2 2/9] btrfs: tree-checker: Make chunk item checker more readable

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn Although I think it would've been worth to explicitly mention that you increased the severity level from error to critical. -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 91

Re: [PATCh v2 1/9] btrfs: Move btrfs_check_chunk_valid() to tree-check.[ch] and export it

2019-03-20 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes ThumshirnSUSE Labs Filesystems jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: delayed_refs has NO entry / btrfs_update_root:136: Aborting unused transaction(No space left).

2019-03-20 Thread Johannes Thumshirn
On 20/03/2019 01:59, Christoph Anton Mitterer wrote: > Anything I should do with respect to this? > > I.e. is further debug info needed for an interested developer? or can I > simply scrap that particular image (which is not an important one)? OK, I can give it a shot, but please be aware I'm st