summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-07-15 00:09:37 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-07-15 00:09:37 -0400
commitc8e15130e1636f68d5165aa2605b8e9cba0f644c (patch)
tree63136907d8f8c602a0ddfd9cc8861a05531d74d7 /fs/ext4
parent8acd5e9b1217e58a57124d9e225afa12efeae20d (diff)
downloadlinux-c8e15130e1636f68d5165aa2605b8e9cba0f644c.tar.bz2
ext4: simplify calculation of blocks to free on error
In ext4_ext_map_blocks(), if we have successfully allocated the data blocks, but then run into trouble inserting the extent into the extent tree, most likely due to an ENOSPC condition, determine the arguments to ext4_free_blocks() in a simpler way which is easier to prove to be correct. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f57cc0e7f1bc..593091537e76 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4261,8 +4261,8 @@ got_allocated_blocks:
/* not a good idea to call discard here directly,
* but otherwise we'd need to call it every free() */
ext4_discard_preallocations(inode);
- ext4_free_blocks(handle, inode, NULL, ext4_ext_pblock(&newex),
- ext4_ext_get_actual_len(&newex), fb_flags);
+ ext4_free_blocks(handle, inode, NULL, newblock,
+ EXT4_C2B(sbi, allocated_clusters), fb_flags);
goto out2;
}