* [PATCH] ext4: simplify calculation of blocks to free on error
@ 2013-07-15 4:11 Theodore Ts'o
0 siblings, 0 replies; only message in thread
From: Theodore Ts'o @ 2013-07-15 4:11 UTC (permalink / raw)
To: Ext4 Developers List; +Cc: Theodore Ts'o
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>
---
fs/ext4/extents.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f57cc0e..5930915 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;
}
--
1.7.12.rc0.22.gcdd159b
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-15 4:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-15 4:11 [PATCH] ext4: simplify calculation of blocks to free on error Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).