All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allison Henderson <achender@linux.vnet.ibm.com>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC
Date: Thu, 12 May 2011 10:59:20 -0700	[thread overview]
Message-ID: <4DCC1FF8.6040103@linux.vnet.ibm.com> (raw)

Hi all,

I wasnt sure if people were expecting a v2 for this one, but I noticed 
the modified version of v1 was removed from the tree, so I am assuming 
we needed v2?  This one handles marking the buffer dirty before calling 
do split to avoid the null pointer.  It introduces a little overhead, 
but the only other option would be to introduce a new flag set to 
do_split.  But if there's any one that would prefer the flags to this 
solution, please let me know.  Thx! :)

Allison Henderson


Signed-off-by: Allison Henderson <achender@us.ibm.com>

---
:100644 100644 3c7a06e... b754b77... M	fs/ext4/namei.c
  fs/ext4/namei.c |    6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 3c7a06e..b754b77 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1413,6 +1413,10 @@ static int make_indexed_dir(handle_t *handle, 
struct dentry *dentry,
  	frame->at = entries;
  	frame->bh = bh;
  	bh = bh2;
+
+	ext4_handle_dirty_metadata(handle, dir, frame->bh);
+	ext4_handle_dirty_metadata(handle, dir, bh);
+
  	de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
  	if (!de) {
  		/*
@@ -1421,8 +1425,6 @@ static int make_indexed_dir(handle_t *handle, 
struct dentry *dentry,
  		 * with corrupted filesystem.
  		 */
  		ext4_mark_inode_dirty(handle, dir);
-		ext4_handle_dirty_metadata(handle, dir, frame->bh);
-		ext4_handle_dirty_metadata(handle, dir, bh);
  		dx_release(frames);
  		return retval;
  	}
-- 
1.7.1


             reply	other threads:[~2011-05-12 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 17:59 Allison Henderson [this message]
2011-05-15  4:21 ` [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC Ted Ts'o
2011-05-15 15:05   ` Allison Henderson
2011-05-17 17:44 ` Jan Kara
2011-05-18 15:23   ` Allison Henderson

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=4DCC1FF8.6040103@linux.vnet.ibm.com \
    --to=achender@linux.vnet.ibm.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.