shithub: lwext4

Download patch

ref: dbcf9937ca2a64604133b2c38ecea906c90f7f2c
parent: 0c223f83c3592dca2c70697b058095b5c404c740
author: Kaho Ng <ngkaho1234@gmail.com>
date: Tue May 31 15:46:38 EDT 2016

ext4_extent: fix truncate freeing blocks at the wrong boundary

--- a/src/ext4_extent.c
+++ b/src/ext4_extent.c
@@ -1260,8 +1260,8 @@
 			start_ex++;
 		} else {
 			if (start + len - 1 > to) {
-				len -= start + len - 1 - to;
 				new_len = start + len - 1 - to;
+				len -= new_len;
 				new_start = to + 1;
 				newblock += to + 1 - start;
 				ex2 = ex;