[PATCH 4/6] reiser4: discard: don't be overly smart when gluing extents in discard_sorted_merged_extents().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@tailp, @alen and @end must be updated simultaneously because there are expressions
involving combinations of these variables.

Signed-off-by: Ivan Shapovalov <intelfx100@xxxxxxxxx>
---
 fs/reiser4/discard.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/fs/reiser4/discard.c b/fs/reiser4/discard.c
index a8c5336..86ff6e4 100644
--- a/fs/reiser4/discard.c
+++ b/fs/reiser4/discard.c
@@ -366,18 +366,10 @@ static int discard_sorted_merged_extents(struct list_head *head)
 					/*
 					 * jump to the glued extent
 					 */
-					if (end + tailp < next_start + next_len) {
-						/*
-						 * the glued extent doesn't
-						 * fit into the tail padding,
-						 * so update the last one
-						 */
-						tailp = extent_get_tailp(next_start + next_len,
-									 d_off, d_uni);
-						alen += (next_start + next_len - end);
-					}
 					pos = next;
+					alen += (next_start + next_len - end);
 					end = next_start + next_len;
+					tailp = extent_get_tailp(end, d_off, d_uni);
 					/*
 					 * try to glue more extents
 					 */
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux