mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-28 00:52:17 +00:00
btrfs-progs: fix a BUG_ON() condition for write_data_to_disk()
The BUG_ON() condition in write_data_to_disk() is no longer correct. Now write_raid56_with_parity() will return the bytes written of last stripe. Thus a success writeback can trigger the BUG_ON(ret). Fix the condition to (ret < 0). Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
fc6925bfd3
commit
2060120201
@ -990,7 +990,7 @@ int write_data_to_disk(struct btrfs_fs_info *info, void *buf, u64 offset,
|
||||
memcpy(eb->data, buf + total_write, this_len);
|
||||
ret = write_raid56_with_parity(info, eb, multi,
|
||||
stripe_len, raid_map);
|
||||
BUG_ON(ret);
|
||||
BUG_ON(ret < 0);
|
||||
|
||||
free(eb);
|
||||
kfree(raid_map);
|
||||
|
Loading…
Reference in New Issue
Block a user