btrfs: reflink: initialize return value to 0 in btrfs_extent_same()
authorSidong Yang <realwakka@gmail.com>
Thu, 26 Aug 2021 14:44:36 +0000 (14:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:00 +0000 (14:04 +0100)
commit428bb3d71e35b41f6ee325d680c56a6d6e9594f8
tree703f53e9bae3144375e3b44cd1d14e143507bee5
parenteeb96ebdc6862fa597daf594e4131d019c7611f7
btrfs: reflink: initialize return value to 0 in btrfs_extent_same()

[ Upstream commit 44bee215f72f13874c0e734a0712c2e3264c0108 ]

Fix a warning reported by smatch that ret could be returned without
initialized.  The dedupe operations are supposed to to return 0 for a 0
length range but the caller does not pass olen == 0. To keep this
behaviour and also fix the warning initialize ret to 0.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/reflink.c