ext4: fix error handling in ext4_ind_get_blocks()
authorJan Kara <jack@suse.cz>
Mon, 23 Nov 2009 12:24:48 +0000 (07:24 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 23 Nov 2009 12:24:48 +0000 (07:24 -0500)
When an error happened in ext4_splice_branch we failed to notice that
in ext4_ind_get_blocks and mapped the buffer anyway. Fix the problem
by checking for error properly.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/inode.c

index 0c0ddc1401e4cde5f3b043b82dfe4f21dea21846..3673ec7b1c98c2783e9e56fb9dde6b13c8f31b30 100644 (file)
@@ -1022,7 +1022,7 @@ static int ext4_ind_get_blocks(handle_t *handle, struct inode *inode,
        if (!err)
                err = ext4_splice_branch(handle, inode, iblock,
                                         partial, indirect_blks, count);
-       else
+       if (err)
                goto cleanup;
 
        set_buffer_new(bh_result);