* Re: 2.4.19-pre8 syntax errors in fs/ufs/super.c
2002-05-04 3:15 2.4.19-pre8 syntax errors in fs/ufs/super.c Ward Fenton
@ 2002-05-04 3:08 ` David S. Miller
2002-05-04 13:41 ` Jan Harkes
1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2002-05-04 3:08 UTC (permalink / raw)
To: ward; +Cc: linux-kernel
From: Ward Fenton <ward@db2adm.com>
Date: Fri, 3 May 2002 23:15:10 -0400 (EDT)
The following is a portion of the 2.4.19-pre8 patch with a correction
for a few syntax errors.
from patch-2.4.19-pre8
missing commas in several added printk statements...
Yeah, I submitted this fix to Marcelo too.
These UFS changes that went into his tree weren't even build tested.
^ permalink raw reply [flat|nested] 3+ messages in thread
* 2.4.19-pre8 syntax errors in fs/ufs/super.c
@ 2002-05-04 3:15 Ward Fenton
2002-05-04 3:08 ` David S. Miller
2002-05-04 13:41 ` Jan Harkes
0 siblings, 2 replies; 3+ messages in thread
From: Ward Fenton @ 2002-05-04 3:15 UTC (permalink / raw)
To: linux-kernel
The following is a portion of the 2.4.19-pre8 patch with a correction
for a few syntax errors.
from patch-2.4.19-pre8
missing commas in several added printk statements...
@@ -653,14 +657,34 @@
uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);
- if (uspi->s_bsize != 4096 && uspi->s_bsize != 8192
- && uspi->s_bsize != 32768) {
- printk("ufs_read_super: fs_bsize %u != {4096, 8192,
32768}\n", uspi->s_bsize);
+ if (uspi->s_fsize & (uspi->s_fsize - 1)) {
+ printk("ufs_read_super: fragment size %u is not a power of
2\n",
+ uspi->s_fsize);
+ goto failed;
+ }
+ if (uspi->s_bsize < 512) {
+ printk("ufs_read_super: fragment size %u is too small\n"
+ uspi->s_fsize);
+ goto failed;
+ }
+ if (uspi->s_bsize > 4096) {
+ printk("ufs_read_super: fragment size %u is too large\n"
+ uspi->s_fsize);
+ goto failed;
+ }
+ if (uspi->s_bsize & (uspi->s_bsize - 1)) {
+ printk("ufs_read_super: block size %u is not a power of
2\n",
+ uspi->s_bsize);
+ goto failed;
+ }
+ if (uspi->s_bsize < 4096) {
+ printk("ufs_read_super: block size %u is too small\n"
+ uspi->s_fsize);
goto failed;
}
- if (uspi->s_fsize != 512 && uspi->s_fsize != 1024
- && uspi->s_fsize != 2048 && uspi->s_fsize != 4096) {
- printk("ufs_read_super: fs_fsize %u != {512, 1024, 2048.
4096}\n", uspi->s_fsize);
+ if (uspi->s_bsize / uspi->s_fsize > 8) {
+ printk("ufs_read_super: too many fragments per block
(%u)\n"
+ uspi->s_bsize / uspi->s_fsize);
goto failed;
}
if (uspi->s_fsize != block_size || uspi->s_sbsize !=
super_block_size) {
Correction for missing commas...
@@ -653,14 +657,34 @@
uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);
- if (uspi->s_bsize != 4096 && uspi->s_bsize != 8192
- && uspi->s_bsize != 32768) {
- printk("ufs_read_super: fs_bsize %u != {4096, 8192,
32768}\n", uspi->s_bsize);
+ if (uspi->s_fsize & (uspi->s_fsize - 1)) {
+ printk("ufs_read_super: fragment size %u is not a power of
2\n",
+ uspi->s_fsize);
+ goto failed;
+ }
+ if (uspi->s_bsize < 512) {
+ printk("ufs_read_super: fragment size %u is too small\n",
+ uspi->s_fsize);
+ goto failed;
+ }
+ if (uspi->s_bsize > 4096) {
+ printk("ufs_read_super: fragment size %u is too large\n",
+ uspi->s_fsize);
+ goto failed;
+ }
+ if (uspi->s_bsize & (uspi->s_bsize - 1)) {
+ printk("ufs_read_super: block size %u is not a power of
2\n",
+ uspi->s_bsize);
+ goto failed;
+ }
+ if (uspi->s_bsize < 4096) {
+ printk("ufs_read_super: block size %u is too small\n",
+ uspi->s_fsize);
goto failed;
}
- if (uspi->s_fsize != 512 && uspi->s_fsize != 1024
- && uspi->s_fsize != 2048 && uspi->s_fsize != 4096) {
- printk("ufs_read_super: fs_fsize %u != {512, 1024, 2048.
4096}\n", uspi->s_fsize);
+ if (uspi->s_bsize / uspi->s_fsize > 8) {
+ printk("ufs_read_super: too many fragments per block
(%u)\n",
+ uspi->s_bsize / uspi->s_fsize);
goto failed;
}
if (uspi->s_fsize != block_size || uspi->s_sbsize !=
super_block_size) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 2.4.19-pre8 syntax errors in fs/ufs/super.c
2002-05-04 3:15 2.4.19-pre8 syntax errors in fs/ufs/super.c Ward Fenton
2002-05-04 3:08 ` David S. Miller
@ 2002-05-04 13:41 ` Jan Harkes
1 sibling, 0 replies; 3+ messages in thread
From: Jan Harkes @ 2002-05-04 13:41 UTC (permalink / raw)
To: Ward Fenton; +Cc: linux-kernel
On Fri, May 03, 2002 at 11:15:10PM -0400, Ward Fenton wrote:
> The following is a portion of the 2.4.19-pre8 patch with a correction
> for a few syntax errors.
>
> from patch-2.4.19-pre8
> missing commas in several added printk statements...
That's not just the only problem,
> + if (uspi->s_bsize < 512) {
> + printk("ufs_read_super: fragment size %u is too small\n"
> + uspi->s_fsize);
> + goto failed;
> + }
> + if (uspi->s_bsize > 4096) {
> + printk("ufs_read_super: fragment size %u is too large\n"
> + uspi->s_fsize);
> + goto failed;
> + }
The patch is testing s_bsize and complains about s_fsize.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-04 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-04 3:15 2.4.19-pre8 syntax errors in fs/ufs/super.c Ward Fenton
2002-05-04 3:08 ` David S. Miller
2002-05-04 13:41 ` Jan Harkes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).