All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.5.46 ext3 errors
@ 2002-11-06  7:54 Jens Axboe
  2002-11-06  8:26 ` Jens Axboe
  2002-11-06 23:55 ` Maciej Babinski
  0 siblings, 2 replies; 6+ messages in thread
From: Jens Axboe @ 2002-11-06  7:54 UTC (permalink / raw)
  To: Linux Kernel

Hi,

Doing a kernel compile, the file system suddenly turned read-only.
Following messages appeared in log:

EXT3-fs error (device ide1(22,1)): ext3_new_inode: Free inodes count corrupted in group 688 Aborting journal on device ide1(22,1).
ext3_new_inode: aborting transaction: Journal has aborted in __ext3_journal_get_write_access<2>EXT3-fs error (device ide1(22,1)) in ext3_new_inode: Journal has aborted
EXT3-fs error (device ide1(22,1)) in ext3_create: Journal has aborted ext3_abort called.
EXT3-fs abort (device ide1(22,1)): ext3_journal_start: Detected aborted journal
Remounting filesystem read-only

-- 
Jens Axboe


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

* Re: 2.5.46 ext3 errors
  2002-11-06  7:54 2.5.46 ext3 errors Jens Axboe
@ 2002-11-06  8:26 ` Jens Axboe
  2002-11-06 12:51   ` Stephen Rothwell
  2002-11-06 23:55 ` Maciej Babinski
  1 sibling, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2002-11-06  8:26 UTC (permalink / raw)
  To: Linux Kernel; +Cc: ext2-devel

On Wed, Nov 06 2002, Jens Axboe wrote:
> Hi,
> 
> Doing a kernel compile, the file system suddenly turned read-only.
> Following messages appeared in log:
> 
> EXT3-fs error (device ide1(22,1)): ext3_new_inode: Free inodes count corrupted in group 688 Aborting journal on device ide1(22,1).
> ext3_new_inode: aborting transaction: Journal has aborted in __ext3_journal_get_write_access<2>EXT3-fs error (device ide1(22,1)) in ext3_new_inode: Journal has aborted
> EXT3-fs error (device ide1(22,1)) in ext3_create: Journal has aborted ext3_abort called.
> EXT3-fs abort (device ide1(22,1)): ext3_journal_start: Detected aborted journal
> Remounting filesystem read-only

fsck gave, for that group:

Free inodes count wrong for group #688 (65534, counted=0)

I've got full fsck log if anyone wants to see it, it consists of wrong
inode and directory counts only.

-- 
Jens Axboe


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

* Re: 2.5.46 ext3 errors
  2002-11-06  8:26 ` Jens Axboe
@ 2002-11-06 12:51   ` Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2002-11-06 12:51 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, ext2-devel

On Wed, 6 Nov 2002 09:26:58 +0100 Jens Axboe <axboe@suse.de> wrote:
>
> On Wed, Nov 06 2002, Jens Axboe wrote:
> > Hi,
> > 
> > Doing a kernel compile, the file system suddenly turned read-only.
> > Following messages appeared in log:
> > 
> > EXT3-fs error (device ide1(22,1)): ext3_new_inode: Free inodes count corrupted in group 688 Aborting journal on device ide1(22,1).
> > ext3_new_inode: aborting transaction: Journal has aborted in __ext3_journal_get_write_access<2>EXT3-fs error (device ide1(22,1)) in ext3_new_inode: Journal has aborted
> > EXT3-fs error (device ide1(22,1)) in ext3_create: Journal has aborted ext3_abort called.
> > EXT3-fs abort (device ide1(22,1)): ext3_journal_start: Detected aborted journal
> > Remounting filesystem read-only
> 
> fsck gave, for that group:
> 
> Free inodes count wrong for group #688 (65534, counted=0)

I got the same error, but on reboot, the journal was played and
then the fsck found no errors.

All I did on that filesystem was
	log in
	make modules_install in a kernel tree
	edit a file in the kernel tree (this file had at least two links)
	make modules - which discovered the files system read only.

After the reboot, the file was as I had changed it, so I lost nothing.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

* Re: 2.5.46 ext3 errors
  2002-11-06  7:54 2.5.46 ext3 errors Jens Axboe
  2002-11-06  8:26 ` Jens Axboe
@ 2002-11-06 23:55 ` Maciej Babinski
  2002-11-07  0:24   ` Andrew Morton
  1 sibling, 1 reply; 6+ messages in thread
From: Maciej Babinski @ 2002-11-06 23:55 UTC (permalink / raw)
  To: linux-kernel

I got this same error while running "seq 1000000|xargs touch"
in an otherwise empty directory. It got as far as about 20,000
files before the filesystem was remounted ro.

On Wed, Nov 06, 2002 at 08:54:06AM +0100, Jens Axboe wrote:
> Hi,
> 
> Doing a kernel compile, the file system suddenly turned read-only.
> Following messages appeared in log:
> 
> EXT3-fs error (device ide1(22,1)): ext3_new_inode: Free inodes count corrupted in group 688 Aborting journal on device ide1(22,1).
> ext3_new_inode: aborting transaction: Journal has aborted in __ext3_journal_get_write_access<2>EXT3-fs error (device ide1(22,1)) in ext3_new_inode: Journal has aborted
> EXT3-fs error (device ide1(22,1)) in ext3_create: Journal has aborted ext3_abort called.
> EXT3-fs abort (device ide1(22,1)): ext3_journal_start: Detected aborted journal
> Remounting filesystem read-only
> 
> -- 
> Jens Axboe
> 
> -
> 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/

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

* Re: 2.5.46 ext3 errors
  2002-11-06 23:55 ` Maciej Babinski
@ 2002-11-07  0:24   ` Andrew Morton
  2002-11-07  3:12     ` Maciej Babinski
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2002-11-07  0:24 UTC (permalink / raw)
  To: Maciej Babinski, Jens Axboe, ext2-devel@lists.sourceforge.net
  Cc: linux-kernel

Maciej Babinski wrote:
> 
> I got this same error while running "seq 1000000|xargs touch"
> in an otherwise empty directory. It got as far as about 20,000
> files before the filesystem was remounted ro.
> 

Looks like we had some overeager cut-n-paste in the Orlov
conversion.

The per-blockgroup inode and directory accounting is being
double-accounted for, and we're not journalling the updates...

This should fix it up, but it is untested.


--- 25/fs/ext3/ialloc.c~ext3-inodes-count-fix	Wed Nov  6 16:16:55 2002
+++ 25-akpm/fs/ext3/ialloc.c	Wed Nov  6 16:24:20 2002
@@ -227,11 +227,6 @@ static int find_group_dir(struct super_b
 	}
 	if (!best_desc)
 		return -1;
-	best_desc->bg_free_inodes_count =
-		cpu_to_le16(le16_to_cpu(best_desc->bg_free_inodes_count) - 1);
-	best_desc->bg_used_dirs_count =
-		cpu_to_le16(le16_to_cpu(best_desc->bg_used_dirs_count) + 1);
-	mark_buffer_dirty(best_bh);
 	return best_group;
 }
 
@@ -355,14 +350,7 @@ fallback:
 	}
 
 	return -1;
-
 found:
-	desc->bg_free_inodes_count =
-		cpu_to_le16(le16_to_cpu(desc->bg_free_inodes_count) - 1);
-	desc->bg_used_dirs_count =
-		cpu_to_le16(le16_to_cpu(desc->bg_used_dirs_count) + 1);
-	sbi->s_dir_count++;
-	mark_buffer_dirty(bh);
 	return group;
 }
 
@@ -410,9 +398,6 @@ static int find_group_other(struct super
 	return -1;
 
 found:
-	desc->bg_free_inodes_count =
-		cpu_to_le16(le16_to_cpu(desc->bg_free_inodes_count) - 1);
-	mark_buffer_dirty(bh);
 	return group;
 }
 
@@ -521,9 +506,11 @@ repeat:
 	if (err) goto fail;
 	gdp->bg_free_inodes_count =
 		cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
-	if (S_ISDIR(mode))
+	if (S_ISDIR(mode)) {
 		gdp->bg_used_dirs_count =
 			cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
+		EXT3_SB(sb)->s_dir_count++;
+	}
 	BUFFER_TRACE(bh2, "call ext3_journal_dirty_metadata");
 	err = ext3_journal_dirty_metadata(handle, bh2);
 	if (err) goto fail;

_

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

* Re: 2.5.46 ext3 errors
  2002-11-07  0:24   ` Andrew Morton
@ 2002-11-07  3:12     ` Maciej Babinski
  0 siblings, 0 replies; 6+ messages in thread
From: Maciej Babinski @ 2002-11-07  3:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jens Axboe, ext2-devel@lists.sourceforge.net, linux-kernel

Since I've applied this patch, I can't reproduce the problem. Thanks!

                                             Maciej

> 
> Looks like we had some overeager cut-n-paste in the Orlov
> conversion.
> 
> The per-blockgroup inode and directory accounting is being
> double-accounted for, and we're not journalling the updates...
> 
> This should fix it up, but it is untested.
> 
> 
> --- 25/fs/ext3/ialloc.c~ext3-inodes-count-fix	Wed Nov  6 16:16:55 2002
> +++ 25-akpm/fs/ext3/ialloc.c	Wed Nov  6 16:24:20 2002
> @@ -227,11 +227,6 @@ static int find_group_dir(struct super_b
>  	}
>  	if (!best_desc)
>  		return -1;
> -	best_desc->bg_free_inodes_count =
> -		cpu_to_le16(le16_to_cpu(best_desc->bg_free_inodes_count) - 1);
> -	best_desc->bg_used_dirs_count =
> -		cpu_to_le16(le16_to_cpu(best_desc->bg_used_dirs_count) + 1);
> -	mark_buffer_dirty(best_bh);
>  	return best_group;
>  }
>  
> @@ -355,14 +350,7 @@ fallback:
>  	}
>  
>  	return -1;
> -
>  found:
> -	desc->bg_free_inodes_count =
> -		cpu_to_le16(le16_to_cpu(desc->bg_free_inodes_count) - 1);
> -	desc->bg_used_dirs_count =
> -		cpu_to_le16(le16_to_cpu(desc->bg_used_dirs_count) + 1);
> -	sbi->s_dir_count++;
> -	mark_buffer_dirty(bh);
>  	return group;
>  }
>  
> @@ -410,9 +398,6 @@ static int find_group_other(struct super
>  	return -1;
>  
>  found:
> -	desc->bg_free_inodes_count =
> -		cpu_to_le16(le16_to_cpu(desc->bg_free_inodes_count) - 1);
> -	mark_buffer_dirty(bh);
>  	return group;
>  }
>  
> @@ -521,9 +506,11 @@ repeat:
>  	if (err) goto fail;
>  	gdp->bg_free_inodes_count =
>  		cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
> -	if (S_ISDIR(mode))
> +	if (S_ISDIR(mode)) {
>  		gdp->bg_used_dirs_count =
>  			cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
> +		EXT3_SB(sb)->s_dir_count++;
> +	}
>  	BUFFER_TRACE(bh2, "call ext3_journal_dirty_metadata");
>  	err = ext3_journal_dirty_metadata(handle, bh2);
>  	if (err) goto fail;
> 
> _
> -
> 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/

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

end of thread, other threads:[~2002-11-07  3:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-06  7:54 2.5.46 ext3 errors Jens Axboe
2002-11-06  8:26 ` Jens Axboe
2002-11-06 12:51   ` Stephen Rothwell
2002-11-06 23:55 ` Maciej Babinski
2002-11-07  0:24   ` Andrew Morton
2002-11-07  3:12     ` Maciej Babinski

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.