]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 17:45:02 +0000 (09:45 -0800)
(cherry picked from commit 2bba702d4f88d7b010ec37e2527b552588404ae7)

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c

index 68c9055a4d9158670b032d7256e5d7b1a1a82055..c27816a2c4fdc59f52e94118ba22c69eb2b71038 100644 (file)
@@ -1021,7 +1021,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);