All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC
@ 2011-05-12 17:59 Allison Henderson
  2011-05-15  4:21 ` Ted Ts'o
  2011-05-17 17:44 ` Jan Kara
  0 siblings, 2 replies; 5+ messages in thread
From: Allison Henderson @ 2011-05-12 17:59 UTC (permalink / raw)
  To: Ext4 Developers List

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC
  2011-05-12 17:59 [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC Allison Henderson
@ 2011-05-15  4:21 ` Ted Ts'o
  2011-05-15 15:05   ` Allison Henderson
  2011-05-17 17:44 ` Jan Kara
  1 sibling, 1 reply; 5+ messages in thread
From: Ted Ts'o @ 2011-05-15  4:21 UTC (permalink / raw)
  To: Allison Henderson; +Cc: Ext4 Developers List

On Thu, May 12, 2011 at 10:59:20AM -0700, Allison Henderson wrote:
> 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>

Applied, thanks.  In the future, I'd appreciate it if you resent the
patch with a formal commit description.  I recreated the commit
description from the older patch in this case.

	    	     	   	    	 - Ted

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC
  2011-05-15  4:21 ` Ted Ts'o
@ 2011-05-15 15:05   ` Allison Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2011-05-15 15:05 UTC (permalink / raw)
  To: Ted Ts'o; +Cc: Ext4 Developers List

On 5/14/2011 9:21 PM, Ted Ts'o wrote:
> On Thu, May 12, 2011 at 10:59:20AM -0700, Allison Henderson wrote:
>> 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>
>
> Applied, thanks.  In the future, I'd appreciate it if you resent the
> patch with a formal commit description.  I recreated the commit
> description from the older patch in this case.
>
> 	    	     	   	    	 - Ted

Thanks Ted.  Sorry about the description, I think I have another small 
patch out there like that.  I will send out an update.  Thx!

Allison Henderson

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC
  2011-05-12 17:59 [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC Allison Henderson
  2011-05-15  4:21 ` Ted Ts'o
@ 2011-05-17 17:44 ` Jan Kara
  2011-05-18 15:23   ` Allison Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Kara @ 2011-05-17 17:44 UTC (permalink / raw)
  To: Allison Henderson; +Cc: Ext4 Developers List

  Hello,

On Thu 12-05-11 10:59:20, Allison Henderson wrote:
> 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! :)
  The patch looks OK. Just please CC me next time - a) because ext3 needs a
similar fix (added now) and b) because I was involved with the previous
patch version. Thanks!

								Honza
> 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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC
  2011-05-17 17:44 ` Jan Kara
@ 2011-05-18 15:23   ` Allison Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2011-05-18 15:23 UTC (permalink / raw)
  To: Jan Kara; +Cc: Ext4 Developers List

On 5/17/2011 10:44 AM, Jan Kara wrote:
>    Hello,
>
> On Thu 12-05-11 10:59:20, Allison Henderson wrote:
>> 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! :)
>    The patch looks OK. Just please CC me next time - a) because ext3 needs a
> similar fix (added now) and b) because I was involved with the previous
> patch version. Thanks!
>
> 								Honza

Sure, I just thought I would save people from the extra spam since it 
was already seen, but I will keep you cc'd next time. 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
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-18 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12 17:59 [PATCH v2] NULL pointer when make_indexed_dir returns -ENOSPC Allison Henderson
2011-05-15  4:21 ` Ted Ts'o
2011-05-15 15:05   ` Allison Henderson
2011-05-17 17:44 ` Jan Kara
2011-05-18 15:23   ` Allison Henderson

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.