Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-26 Thread David Sterba
On Tue, Sep 26, 2017 at 08:49:55PM +0800, Qu Wenruo wrote: > > Yeah something like that. And also make it a function, unless we're > > going to use some macro magic (I'm not sure about that yet). > > > > Schematically: > > > > btrfs_report_corruption(fs_info, EXTENT_ITEM, "file item type is unkno

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-26 Thread Qu Wenruo
On 2017年09月26日 20:13, David Sterba wrote: On Tue, Sep 26, 2017 at 08:46:29AM +0800, Qu Wenruo wrote: On 2017年09月26日 08:28, Qu Wenruo wrote: On 2017年09月25日 23:45, David Sterba wrote: On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: Add extra checker for item with EXTENT_DATA type.

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-26 Thread Qu Wenruo
On 2017年09月26日 20:05, David Sterba wrote: On Tue, Sep 26, 2017 at 08:28:25AM +0800, Qu Wenruo wrote: On 2017年09月25日 23:45, David Sterba wrote: On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: Add extra checker for item with EXTENT_DATA type. This checks the following thing: 0) Ke

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-26 Thread David Sterba
On Tue, Sep 26, 2017 at 08:46:29AM +0800, Qu Wenruo wrote: > On 2017年09月26日 08:28, Qu Wenruo wrote: > > On 2017年09月25日 23:45, David Sterba wrote: > >> On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: > >>> Add extra checker for item with EXTENT_DATA type. > >>> This checks the following t

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-26 Thread David Sterba
On Tue, Sep 26, 2017 at 08:28:25AM +0800, Qu Wenruo wrote: > > > On 2017年09月25日 23:45, David Sterba wrote: > > On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: > >> Add extra checker for item with EXTENT_DATA type. > >> This checks the following thing: > >> 0) Key offset > >> All ke

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-25 Thread Qu Wenruo
On 2017年09月26日 08:28, Qu Wenruo wrote: On 2017年09月25日 23:45, David Sterba wrote: On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: Add extra checker for item with EXTENT_DATA type. This checks the following thing: 0) Key offset     All key offset must be aligned to sectorsize.    

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-25 Thread Qu Wenruo
On 2017年09月25日 23:45, David Sterba wrote: On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: Add extra checker for item with EXTENT_DATA type. This checks the following thing: 0) Key offset All key offset must be aligned to sectorsize. Inline extent must have 0 for key offset.

Re: [PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-09-25 Thread David Sterba
On Wed, Aug 23, 2017 at 04:57:58PM +0900, Qu Wenruo wrote: > Add extra checker for item with EXTENT_DATA type. > This checks the following thing: > 0) Key offset >All key offset must be aligned to sectorsize. >Inline extent must have 0 for key offset. > > 1) Item size >Plain text inlin

[PATCH v2 3/4] btrfs: Add sanity check for EXTENT_DATA when reading out leaf

2017-08-23 Thread Qu Wenruo
Add extra checker for item with EXTENT_DATA type. This checks the following thing: 0) Key offset All key offset must be aligned to sectorsize. Inline extent must have 0 for key offset. 1) Item size Plain text inline file extent size must match item size. (compressed inline file extent