Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-07-08 Thread Liu Bo
On Fri, Jul 08, 2016 at 06:05:16PM +0200, David Sterba wrote: > On Tue, May 03, 2016 at 04:30:54PM -0700, Liu Bo wrote: > > > Just a heads up that this seems to introduce a valid warning, since it now > > > can goto error before the first initializing use of path: > > > > > > fs/btrfs/volumes.c: I

Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-07-08 Thread David Sterba
On Tue, May 03, 2016 at 04:30:54PM -0700, Liu Bo wrote: > > Just a heads up that this seems to introduce a valid warning, since it now > > can goto error before the first initializing use of path: > > > > fs/btrfs/volumes.c: In function 'btrfs_balance': > > fs/btrfs/volumes.c:3601:2: warning: 'pat

Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-05-04 Thread David Sterba
On Mon, May 02, 2016 at 04:01:02PM -0700, Liu Bo wrote: > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -3418,13 +3418,25 @@ static int __btrfs_balance(struct btrfs_fs_info > *fs_info) > ret = btrfs_shrink_device(device, old_size - size_to_free); > if (ret ==

Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-05-03 Thread Liu Bo
On Wed, May 04, 2016 at 01:14:27AM +0200, Holger Hoffstätte wrote: > On Tue, May 3, 2016 at 1:01 AM, Liu Bo wrote: > > Mounting a btrfs can resume previous balance operations asynchronously. > > An user got a crash when one drive has some corrupt sectors. > > > > Since balance can cancel itself in

Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-05-03 Thread Holger Hoffstätte
On Tue, May 3, 2016 at 1:01 AM, Liu Bo wrote: > Mounting a btrfs can resume previous balance operations asynchronously. > An user got a crash when one drive has some corrupt sectors. > > Since balance can cancel itself in case of any error, we can gracefully > return errors to upper layers and let

[PATCH] Btrfs: fix unexpected balance crash due to BUG_ON

2016-05-02 Thread Liu Bo
Mounting a btrfs can resume previous balance operations asynchronously. An user got a crash when one drive has some corrupt sectors. Since balance can cancel itself in case of any error, we can gracefully return errors to upper layers and let balance do the cancel job. Reported-by: sash Signed-o