Btrfs: fix unexpected balance crash due to BUG_ON
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 12 Jul 2016 18:24:21 +0000 (11:24 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Jul 2016 11:52:25 +0000 (13:52 +0200)
commit5a488b9d2c25d98cdd11d09de311bfc83ba09fbd
tree3058eb9d14b1e7268b54f1d2f754e598d3c3e22a
parent0fd8c3dae14fb64947842472940b807ca0781da9
Btrfs: fix unexpected balance crash due to BUG_ON

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 <master.b.at.raven@chefmail.de>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c