linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ext4: buffer underrun in ext4_ext_split()?
@ 2009-08-07 18:19 Roel Kluin
  2009-08-07 18:50 ` Roel Kluin
  2009-08-08  3:32 ` Theodore Tso
  0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-08-07 18:19 UTC (permalink / raw)
  To: Theodore Ts'o, linux-ext4, Andrew Morton

If `depth' is less or equal to `at', a buffer underrun occurs

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I am not sure whether this is possible.

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index afea652..25bc182 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -822,7 +822,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
 	}
 
 	/* initialize new leaf */
-	newblock = ablocks[--a];
+	newblock = a ? ablocks[--a] : 0;
 	BUG_ON(newblock == 0);
 	bh = sb_getblk(inode->i_sb, newblock);
 	if (!bh) {

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

* Re: ext4: buffer underrun in ext4_ext_split()?
  2009-08-07 18:19 ext4: buffer underrun in ext4_ext_split()? Roel Kluin
@ 2009-08-07 18:50 ` Roel Kluin
  2009-08-08  3:32 ` Theodore Tso
  1 sibling, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2009-08-07 18:50 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Theodore Ts'o, linux-ext4, Andrew Morton

Op 07-08-09 20:19, Roel Kluin schreef:
> If `depth' is less or equal to `at', a buffer underrun occurs

s/underrun/overflow/g

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

* Re: ext4: buffer underrun in ext4_ext_split()?
  2009-08-07 18:19 ext4: buffer underrun in ext4_ext_split()? Roel Kluin
  2009-08-07 18:50 ` Roel Kluin
@ 2009-08-08  3:32 ` Theodore Tso
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Tso @ 2009-08-08  3:32 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-ext4, Andrew Morton

On Fri, Aug 07, 2009 at 08:19:49PM +0200, Roel Kluin wrote:
> If `depth' is less or equal to `at', a buffer underrun occurs
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> I am not sure whether this is possible.

I'm pretty sure this could never happen.  ext4_ext_split is only
called from one place, and only when the leaf node is full.

       	    	       	   	     	      - Ted

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

end of thread, other threads:[~2009-08-08  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 18:19 ext4: buffer underrun in ext4_ext_split()? Roel Kluin
2009-08-07 18:50 ` Roel Kluin
2009-08-08  3:32 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).