Skip to contentSkip to conversation

Fix for ext2 reservation (Re: -mm merge plans for 2.6.23)

PATHC Badari Pulavarty 3 participants 4 messages Jul 10, 2007 – Jul 11, 2007 2 messages not in the archive ext2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 15 lines · Martin Bligh
Quoted 14 lines · Andrew Morton

Begin forwarded message:

Date: Tue, 10 Jul 2007 21:49:23 +0400
From: Alexey Dobriyan <[email protected]>
To: Andrew Morton <[email protected]>
Cc: [email protected], [email protected]
Subject: ext2 reservations (Re: -mm merge plans for 2.6.23)

Quoted 3 lines

ext2-reservations.patch

Still needs decent testing.

Quoted 8 lines
Quoted 5 lines

Was this oops silently fixed?
http://lkml.org/lkml/2007/3/2/138
2.6.21-rc2-mm1: EIP is at ext2_discard_reservation+0x1c/0x52

I still have that ext2 partition backed up.

Now I'm confused - I thought there was a latent issue there, and then we went back and revisited it, and we decided there wasn't ;-(

Well, I looked at the problem now and here is the fix :)

Greg, Please consider this for stable release also.

Thanks,
Badari

ext2 reservation fix - Alexey Dobriyan reported ext2 discard reservation panic while ago (http://lkml.org/lkml/2007/3/2/138).
If ext2_new_inode() fails for any reason it would end up calling ext2_discard_reservation() (due to last iput). Normally, it does nothing since we don't have a reservation window structure allocated. But the NULL pointer check wouldn't work with slab poisioning, and causes oops.

Fix is to initialize i_block_alloc_info to NULL in ext2_alloc_inode() code instead of assuming that it would be NULL. Same fix already exists in ext3 and ext4.

 fs/ext2/super.c |    1 +
 1 file changed, 1 insertion(+)
fs/ext2/super.c +1 -0
Index: linux-2.6.22/fs/ext2/super.c
===================================================================
@@ -147,6 +147,7 @@ static struct inode *ext2_alloc_inode(st
 	ei->i_acl = EXT2_ACL_NOT_CACHED;
 	ei->i_default_acl = EXT2_ACL_NOT_CACHED;
 #endif
+	ei->i_block_alloc_info = NULL;
 	ei->vfs_inode.i_version = 1;
 	return &ei->vfs_inode;
 }
#3 lore raw
Quoted 1 line · On Tue, 10 Jul 2007 15:15:57 -0700 Badari Pulavarty <[email protected]> wrote:

Well, I looked at the problem now and here is the fix :)

whee, thanks.

Quoted 1 line

Greg, Please consider this for stable release also.

No, it is only relevant to -mm's ext2-reservations.patch.

#4 lore raw
Quoted 10 lines · Andrew Morton
Quoted 1 line · On Tue, 10 Jul 2007 15:15:57 -0700 Badari Pulavarty <[email protected]> wrote:

Well, I looked at the problem now and here is the fix :)

whee, thanks.

Quoted 1 line

Greg, Please consider this for stable release also.

No, it is only relevant to -mm's ext2-reservations.patch.

Yes. Sorry. I was looking at -mm tree and assumed that ext2-reservation code made into mainline also :(

Greg, please ignore the patch for stable.

Thanks,
Badari

#5 lore raw
Quoted 8 lines · Badari Pulavarty
Quoted 7 lines · Andrew Morton
Quoted 1 line · On Tue, 10 Jul 2007 15:15:57 -0700 Badari Pulavarty <[email protected]> wrote:

Well, I looked at the problem now and here is the fix :)

whee, thanks.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Greg, Please consider this for stable release also.

No, it is only relevant to -mm's ext2-reservations.patch.

Yes. Sorry. I was looking at -mm tree and assumed that ext2-reservation code made into mainline also :(

Greg, please ignore the patch for stable.

Ok, dropped from my -stable queue mbox.

thanks,

greg k-h