Re: ext3 corruption

From: Andrew Morton (akpm@zip.com.au)
Date: Fri Jul 12 2002 - 14:51:13 EST


Russell King wrote:
>
> On Fri, Jul 12, 2002 at 11:32:44AM -0400, Alec Smith wrote:
> > Over the last month or so, I've noticed the following error showing up
> > repeatedly in my system logs under kernel 2.4.18-ac3 and more recently
> > under 2.4.19-rc1:
> >
> > EXT3-fs error (device ide0(3,3)) in ext3_new_inode: error 28
>
> Erm, that looks like the old "out of inodes, return -ENOSPC and mark the
> filesystem read only" bug I found several months ago. iirc, there have
> been 3 recent issues (in the last three months) that I'm aware of:
>
> 1. running out of free blocks.
> 2. running out of free inodes.
> 3. i_nlink accounting goofup.
>
> I've got patches from akpm for (1) and (3), but not (2). I'd be nice to
> have all three solved for 2.4.19.

Whoa. Thanks for the reminder. Fixed in 2.5, fixed in ext3
CVS, forgotten in Linux.

Marcelo, please. The patch makes ext3 return -ENOSPC when it
runs out of inodes rather than remounting the fs readonly
or forcing a panic.

--- 2.4.19-rc1/fs/ext3/ialloc.c~ext3-ialloc Fri Jul 12 12:47:58 2002
+++ 2.4.19-rc1-akpm/fs/ext3/ialloc.c Fri Jul 12 12:48:06 2002
@@ -392,7 +392,7 @@ repeat:
 
         err = -ENOSPC;
         if (!gdp)
- goto fail;
+ goto out;
 
         err = -EIO;
         bitmap_nr = load_inode_bitmap (sb, i);
@@ -523,9 +523,10 @@ repeat:
         return inode;
 
 fail:
+ ext3_std_error(sb, err);
+out:
         unlock_super(sb);
         iput(inode);
- ext3_std_error(sb, err);
         return ERR_PTR(err);
 }
 

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:23 EST