public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sb_read problem in hpfs
@ 2002-02-20 13:00 Chris Mason
  2002-02-20 13:11 ` Alexander Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Mason @ 2002-02-20 13:00 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel


Hi guys,

hpfs_read_super triggers calls to sb_bread (through hpfs_map_sector) 
before setting s_blocksize.  This leads to a BUG() in grow_buffers.

This patch was tested lightly, hpfs_read_super completes
properly when an hpfs FS is not present.

-chris

--- suse.4/fs/hpfs/super.c Tue, 19 Feb 2002 08:55:47 -0500 
+++ suse.4(w)/fs/hpfs/super.c Tue, 19 Feb 2002 22:28:37 -0500 
@@ -410,6 +410,8 @@
 	/*s->s_hpfs_mounting = 1;*/
 	dev = s->s_dev;
 	set_blocksize(dev, 512);
+	s->s_blocksize = 512;
+	s->s_blocksize_bits = 9;
 	s->s_hpfs_fs_size = -1;
 	if (!(bootblock = hpfs_map_sector(s, 0, &bh0, 0))) goto bail1;
 	if (!(superblock = hpfs_map_sector(s, 16, &bh1, 1))) goto bail2;
@@ -436,8 +438,6 @@
 
 	/* Fill superblock stuff */
 	s->s_magic = HPFS_SUPER_MAGIC;
-	s->s_blocksize = 512;
-	s->s_blocksize_bits = 9;
 	s->s_op = &hpfs_sops;
 
 	s->s_hpfs_root = superblock->root;


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

* Re: [PATCH] sb_read problem in hpfs
  2002-02-20 13:00 [PATCH] sb_read problem in hpfs Chris Mason
@ 2002-02-20 13:11 ` Alexander Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Viro @ 2002-02-20 13:11 UTC (permalink / raw)
  To: Chris Mason; +Cc: Marcelo Tosatti, linux-kernel



On Wed, 20 Feb 2002, Chris Mason wrote:

> 
> Hi guys,
> 
> hpfs_read_super triggers calls to sb_bread (through hpfs_map_sector) 
> before setting s_blocksize.  This leads to a BUG() in grow_buffers.

Fsck.  Merge problems when backporting to 2.4 - thanks for spotting.
Yes, patch is correct.  I'll look through the rest of thing and see
what else is missing.
 
> This patch was tested lightly, hpfs_read_super completes
> properly when an hpfs FS is not present.
> 
> -chris
> 
> --- suse.4/fs/hpfs/super.c Tue, 19 Feb 2002 08:55:47 -0500 
> +++ suse.4(w)/fs/hpfs/super.c Tue, 19 Feb 2002 22:28:37 -0500 
> @@ -410,6 +410,8 @@
>  	/*s->s_hpfs_mounting = 1;*/
>  	dev = s->s_dev;
>  	set_blocksize(dev, 512);
> +	s->s_blocksize = 512;
> +	s->s_blocksize_bits = 9;
>  	s->s_hpfs_fs_size = -1;
>  	if (!(bootblock = hpfs_map_sector(s, 0, &bh0, 0))) goto bail1;
>  	if (!(superblock = hpfs_map_sector(s, 16, &bh1, 1))) goto bail2;
> @@ -436,8 +438,6 @@
>  
>  	/* Fill superblock stuff */
>  	s->s_magic = HPFS_SUPER_MAGIC;
> -	s->s_blocksize = 512;
> -	s->s_blocksize_bits = 9;
>  	s->s_op = &hpfs_sops;
>  
>  	s->s_hpfs_root = superblock->root;
> 
> 


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

end of thread, other threads:[~2002-02-20 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-20 13:00 [PATCH] sb_read problem in hpfs Chris Mason
2002-02-20 13:11 ` Alexander Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox