diff mbox series

btrfs: return 0 for dev_extent_hole_check_zoned hole_start in case of error

Message ID 145b97e8743f76c436971d3066d94d5073e7ffa0.1620653896.git.johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs: return 0 for dev_extent_hole_check_zoned hole_start in case of error | expand

Commit Message

Johannes Thumshirn May 10, 2021, 1:39 p.m. UTC
Commit 7000babddac6 ("btrfs: assign proper values to a bool variable in
dev_extent_hole_check_zoned") assigned false to the hole_start parameter
of dev_extent_hole_check_zoned().

The hole_start parameter is not boolean and returns the start location of
the found hole.

Fixes: 7000babddac6 ("btrfs: assign proper values to a bool variable in dev_extent_hole_check_zoned")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Sterba May 10, 2021, 7:01 p.m. UTC | #1
On Mon, May 10, 2021 at 10:39:38PM +0900, Johannes Thumshirn wrote:
> Commit 7000babddac6 ("btrfs: assign proper values to a bool variable in
> dev_extent_hole_check_zoned") assigned false to the hole_start parameter
> of dev_extent_hole_check_zoned().
> 
> The hole_start parameter is not boolean and returns the start location of
> the found hole.
> 
> Fixes: 7000babddac6 ("btrfs: assign proper values to a bool variable in dev_extent_hole_check_zoned")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0ba7b3c5933b..e020447b25a2 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1459,7 +1459,7 @@  static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 		/* Given hole range was invalid (outside of device) */
 		if (ret == -ERANGE) {
 			*hole_start += *hole_size;
-			*hole_size = false;
+			*hole_size = 0;
 			return true;
 		}