All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schlick <schlick@lavabit.com>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: [PATCH 1/2] ext4: Always set dx_node's fake_dirent explicitly.
Date: Sun, 30 Aug 2009 16:57:50 +0200	[thread overview]
Message-ID: <200908301657.50561.schlick@lavabit.com> (raw)
In-Reply-To: <200908301656.40866.schlick@lavabit.com>

When ext4_dx_add_entry() has to split an index node, it has to ensure that
name_len of dx_node's fake_dirent is also zero, because otherwise e2fsck
won't recognise it as an intermediate htree node and consider the htree to
be corrupted.

Signed-off-by: Andreas Schlick <schlick@lavabit.com>
---
 fs/ext4/namei.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 22098e1..682a488 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1590,9 +1590,9 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
 			goto cleanup;
 		node2 = (struct dx_node *)(bh2->b_data);
 		entries2 = node2->entries;
+		memset(&node2->fake, 0, sizeof(struct fake_dirent));
 		node2->fake.rec_len = ext4_rec_len_to_disk(sb->s_blocksize,
 							   sb->s_blocksize);
-		node2->fake.inode = 0;
 		BUFFER_TRACE(frame->bh, "get_write_access");
 		err = ext4_journal_get_write_access(handle, frame->bh);
 		if (err)
-- 
1.6.4



  reply	other threads:[~2009-08-30 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-30 14:56 [PATCH 0/2] Fix wrong name_len and file_type in intermediate htree nodes Andreas Schlick
2009-08-30 14:57 ` Andreas Schlick [this message]
2009-08-30 14:58   ` [PATCH 2/2] ext3: Always set dx_node's fake_dirent explicitly Andreas Schlick
2009-09-11  3:19   ` [PATCH 1/2] ext4: " Theodore Tso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200908301657.50561.schlick@lavabit.com \
    --to=schlick@lavabit.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.