[PATCH 3/5] fix ext2fs_extent_insert when at last extent in node

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

 



ext2fs_extent_insert() only did a memmove if path->left
was > 0, but if we are at the last extent in the node,
path->left == 0, and this node must be moved before the
current extent is replaced with the newly inserted node.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---
 lib/ext2fs/extent.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index 76f6f65..9f19e7b 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -689,7 +689,7 @@ errcode_t ext2fs_extent_insert(ext2_extent_handle_t handle, int flags,
 
 	path->curr = ix;
 
-	if (path->left > 0)
+	if (path->left >= 0)
 		memmove(ix + 1, ix,
 			(path->left+1) * sizeof(struct ext3_extent_idx));
 	path->left++;
-- 
1.5.4.1

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

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux