diff options
author | Omar Sandoval <osandov@fb.com> | 2017-08-22 23:45:59 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-08-24 17:19:02 +0200 |
commit | 58efbc9f5463308c43d812fd0748a4dee44c8a16 (patch) | |
tree | 400bd7ce429cf0ef769c3736dcb153f28dfdbcee /fs/btrfs/disk-io.c | |
parent | 14ccee78fc82f5512908f4424f541549a5705b89 (diff) | |
download | linux-stable-58efbc9f5463308c43d812fd0748a4dee44c8a16.tar.gz linux-stable-58efbc9f5463308c43d812fd0748a4dee44c8a16.tar.bz2 linux-stable-58efbc9f5463308c43d812fd0748a4dee44c8a16.zip |
Btrfs: fix blk_status_t/errno confusion
This fixes several instances of blk_status_t and bare errno ints being
mixed up, some of which are real bugs.
In the normal case, 0 matches BLK_STS_OK, so we don't observe any
effects of the missing conversion, but in case of errors or passes
through the repair/retry paths, the errors get mixed up.
The changes were identified using 'sparse', we don't have reports of the
buggy behaviour.
Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 080e2ebb8aa0..f45b61fe9a9a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3516,7 +3516,7 @@ static blk_status_t wait_dev_flush(struct btrfs_device *device) struct bio *bio = device->flush_bio; if (!device->flush_bio_sent) - return 0; + return BLK_STS_OK; device->flush_bio_sent = 0; wait_for_completion_io(&device->flush_wait); @@ -3563,7 +3563,7 @@ static int barrier_all_devices(struct btrfs_fs_info *info) continue; write_dev_flush(dev); - dev->last_flush_error = 0; + dev->last_flush_error = BLK_STS_OK; } /* wait for all the barriers */ |