Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-21 Thread David Sterba
On Tue, Sep 20, 2016 at 10:59:59AM -0700, Liu Bo wrote: > On Tue, Sep 20, 2016 at 10:03:43AM +0200, David Sterba wrote: > > On Mon, Sep 19, 2016 at 04:11:44PM -0700, Liu Bo wrote: > > > > > That's EIO. Sometimes the EIO is big enough we have to abort, but > > > > > really the abort is just adding

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-20 Thread Liu Bo
On Tue, Sep 20, 2016 at 10:03:43AM +0200, David Sterba wrote: > On Mon, Sep 19, 2016 at 04:11:44PM -0700, Liu Bo wrote: > > > > That's EIO. Sometimes the EIO is big enough we have to abort, but > > > > really the abort is just adding bonus. > > > > > > I think we misuse the EIO where we should r

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-20 Thread David Sterba
On Mon, Sep 19, 2016 at 04:11:44PM -0700, Liu Bo wrote: > > > That's EIO. Sometimes the EIO is big enough we have to abort, but > > > really the abort is just adding bonus. > > > > I think we misuse the EIO where we should really return EFSCORRUPTED > > that's an alias for EUCLEAN, looking at xf

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-19 Thread Liu Bo
On Mon, Sep 19, 2016 at 08:01:05PM +0200, David Sterba wrote: > On Thu, Sep 15, 2016 at 02:58:12PM -0400, Chris Mason wrote: > > > > > > On 09/15/2016 03:01 PM, Liu Bo wrote: > > > On Wed, Sep 14, 2016 at 11:19:04AM -0700, Liu Bo wrote: > > >> On Wed, Sep 14, 2016 at 01:31:31PM -0400, Josef Bacik

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-19 Thread David Sterba
On Thu, Sep 15, 2016 at 02:58:12PM -0400, Chris Mason wrote: > > > On 09/15/2016 03:01 PM, Liu Bo wrote: > > On Wed, Sep 14, 2016 at 11:19:04AM -0700, Liu Bo wrote: > >> On Wed, Sep 14, 2016 at 01:31:31PM -0400, Josef Bacik wrote: > >>> On 09/14/2016 01:29 PM, Chris Mason wrote: > > > >

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-15 Thread Chris Mason
On 09/15/2016 03:01 PM, Liu Bo wrote: On Wed, Sep 14, 2016 at 11:19:04AM -0700, Liu Bo wrote: On Wed, Sep 14, 2016 at 01:31:31PM -0400, Josef Bacik wrote: On 09/14/2016 01:29 PM, Chris Mason wrote: On 09/14/2016 01:13 PM, Josef Bacik wrote: On 09/14/2016 12:27 PM, Liu Bo wrote: While upd

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-15 Thread Liu Bo
On Wed, Sep 14, 2016 at 11:19:04AM -0700, Liu Bo wrote: > On Wed, Sep 14, 2016 at 01:31:31PM -0400, Josef Bacik wrote: > > On 09/14/2016 01:29 PM, Chris Mason wrote: > > > > > > > > > On 09/14/2016 01:13 PM, Josef Bacik wrote: > > > > On 09/14/2016 12:27 PM, Liu Bo wrote: > > > > > While updating

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-14 Thread Liu Bo
On Wed, Sep 14, 2016 at 01:31:31PM -0400, Josef Bacik wrote: > On 09/14/2016 01:29 PM, Chris Mason wrote: > > > > > > On 09/14/2016 01:13 PM, Josef Bacik wrote: > > > On 09/14/2016 12:27 PM, Liu Bo wrote: > > > > While updating btree, we try to push items between sibling > > > > nodes/leaves in o

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-14 Thread Liu Bo
On Wed, Sep 14, 2016 at 01:13:34PM -0400, Josef Bacik wrote: > On 09/14/2016 12:27 PM, Liu Bo wrote: > > While updating btree, we try to push items between sibling > > nodes/leaves in order to keep height as low as possible. > > But we don't memset the original places with zero when > > pushing ite

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-14 Thread Josef Bacik
On 09/14/2016 01:29 PM, Chris Mason wrote: On 09/14/2016 01:13 PM, Josef Bacik wrote: On 09/14/2016 12:27 PM, Liu Bo wrote: While updating btree, we try to push items between sibling nodes/leaves in order to keep height as low as possible. But we don't memset the original places with zero whe

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-14 Thread Chris Mason
On 09/14/2016 01:13 PM, Josef Bacik wrote: On 09/14/2016 12:27 PM, Liu Bo wrote: While updating btree, we try to push items between sibling nodes/leaves in order to keep height as low as possible. But we don't memset the original places with zero when pushing items so that we could end up leav

Re: [PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-14 Thread Josef Bacik
On 09/14/2016 12:27 PM, Liu Bo wrote: While updating btree, we try to push items between sibling nodes/leaves in order to keep height as low as possible. But we don't memset the original places with zero when pushing items so that we could end up leaving stale content in nodes/leaves. One may re

[PATCH] Btrfs: kill BUG_ON in do_relocation

2016-09-14 Thread Liu Bo
While updating btree, we try to push items between sibling nodes/leaves in order to keep height as low as possible. But we don't memset the original places with zero when pushing items so that we could end up leaving stale content in nodes/leaves. One may read the above stale content by increasing