]> git.hungrycats.org Git - linux/commitdiff
btrfs: fix lost return value due to variable shadowing
authorDavid Sterba <dsterba@suse.cz>
Tue, 24 Feb 2015 17:57:18 +0000 (18:57 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Sun, 8 Mar 2015 04:06:35 +0000 (23:06 -0500)
A block-local variable stores error code but btrfs_get_blocks_direct may
not return it in the end as there's a ret defined in the function scope.

CC: <stable@vger.kernel.org> # 3.6+
Fixes: d187663ef24c ("Btrfs: lock extents as we map them in DIO")
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 1932b7be973b554ffe20a5bba6ffaed6fa995cdc)

fs/btrfs/inode.c

index b2004f1d8abbb3d3ca569de1dda895a43d6375aa..97f351299c5a6128ecb18a491f0e735a92521f54 100644 (file)
@@ -7233,7 +7233,6 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
            ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) &&
             em->block_start != EXTENT_MAP_HOLE)) {
                int type;
-               int ret;
                u64 block_start, orig_start, orig_block_len, ram_bytes;
 
                if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags))