* [PATCH] ext3: Don't update the superblock in ext3_statfs()
@ 2009-11-16 22:34 Eric Sandeen
2009-11-19 16:09 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-11-16 22:34 UTC (permalink / raw)
To: ext4 development; +Cc: Jan Kara
commit a71ce8c6c9bf269b192f352ea555217815cf027e updated ext3_statfs()
to update the on-disk superblock counters, but modified this buffer
directly without any journaling of the change. This is one of the
accesses that was causing the crc errors in journal replay as seen in
kernel.org bugzilla #14354.
The modifications were originally to keep the sb "more" in sync,
so that a readonly fsck of the device didn't flag this as an
error (as often), but apparently e2fsprogs deals with this differently
now, anyway.
Based on Ted's patch for ext4, which was in turn based on my
work on that bug and another preliminary patch...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 427496c..ca3068f 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2686,13 +2686,11 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)
buf->f_bsize = sb->s_blocksize;
buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last;
buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter);
- es->s_free_blocks_count = cpu_to_le32(buf->f_bfree);
buf->f_bavail = buf->f_bfree - le32_to_cpu(es->s_r_blocks_count);
if (buf->f_bfree < le32_to_cpu(es->s_r_blocks_count))
buf->f_bavail = 0;
buf->f_files = le32_to_cpu(es->s_inodes_count);
buf->f_ffree = percpu_counter_sum_positive(&sbi->s_freeinodes_counter);
- es->s_free_inodes_count = cpu_to_le32(buf->f_ffree);
buf->f_namelen = EXT3_NAME_LEN;
fsid = le64_to_cpup((void *)es->s_uuid) ^
le64_to_cpup((void *)es->s_uuid + sizeof(u64));
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext3: Don't update the superblock in ext3_statfs()
2009-11-16 22:34 [PATCH] ext3: Don't update the superblock in ext3_statfs() Eric Sandeen
@ 2009-11-19 16:09 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2009-11-19 16:09 UTC (permalink / raw)
To: Eric Sandeen; +Cc: ext4 development, Jan Kara
On Mon 16-11-09 16:34:51, Eric Sandeen wrote:
> commit a71ce8c6c9bf269b192f352ea555217815cf027e updated ext3_statfs()
> to update the on-disk superblock counters, but modified this buffer
> directly without any journaling of the change. This is one of the
> accesses that was causing the crc errors in journal replay as seen in
> kernel.org bugzilla #14354.
>
> The modifications were originally to keep the sb "more" in sync,
> so that a readonly fsck of the device didn't flag this as an
> error (as often), but apparently e2fsprogs deals with this differently
> now, anyway.
>
> Based on Ted's patch for ext4, which was in turn based on my
> work on that bug and another preliminary patch...
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Thanks. Merged into my tree.
Honza
> ---
>
> diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> index 427496c..ca3068f 100644
> --- a/fs/ext3/super.c
> +++ b/fs/ext3/super.c
> @@ -2686,13 +2686,11 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)
> buf->f_bsize = sb->s_blocksize;
> buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last;
> buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter);
> - es->s_free_blocks_count = cpu_to_le32(buf->f_bfree);
> buf->f_bavail = buf->f_bfree - le32_to_cpu(es->s_r_blocks_count);
> if (buf->f_bfree < le32_to_cpu(es->s_r_blocks_count))
> buf->f_bavail = 0;
> buf->f_files = le32_to_cpu(es->s_inodes_count);
> buf->f_ffree = percpu_counter_sum_positive(&sbi->s_freeinodes_counter);
> - es->s_free_inodes_count = cpu_to_le32(buf->f_ffree);
> buf->f_namelen = EXT3_NAME_LEN;
> fsid = le64_to_cpup((void *)es->s_uuid) ^
> le64_to_cpup((void *)es->s_uuid + sizeof(u64));
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-19 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-16 22:34 [PATCH] ext3: Don't update the superblock in ext3_statfs() Eric Sandeen
2009-11-19 16:09 ` Jan Kara
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.