[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A3910BA.5040105@redhat.com>
Date: Wed, 17 Jun 2009 10:50:18 -0500
From: Eric Sandeen <sandeen@...hat.com>
To: Theodore Tso <tytso@....edu>
CC: ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] libext2fs: write only core inode in update_path()
Theodore Tso wrote:
>
> Probably it would be better/simpler to replace this with:
>
> retval = ext2fs_write_inode(handle->fs, handle->ino,
> handle->inode);
>
> - Ted
>
Sure, that makes more sense, revised below:
libext2fs: write only core inode in update_path()
The ext2_extent_handle only has a struct ext2_inode allocated on
it, and the same amount copied into it in that same function,
but in update_path() we're possibly writing out more than that -
for example 256 bytes, from that address. This causes uninitialized
memory to get written to disk, overwriting the parts of the
inode past the osd2 member (the end of the smaller structure).
Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---
diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index b7eb617..15ce302 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -546,8 +546,8 @@ static errcode_t update_path(ext2_extent_handle_t handle)
struct ext3_extent_idx *ix;
if (handle->level == 0) {
- retval = ext2fs_write_inode_full(handle->fs, handle->ino,
- handle->inode, EXT2_INODE_SIZE(handle->fs->super));
+ retval = ext2fs_write_inode(handle->fs, handle->ino,
+ handle->inode);
} else {
ix = handle->path[handle->level - 1].curr;
blk = ext2fs_le32_to_cpu(ix->ei_leaf) +
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists