mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 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

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

all inboxes | Powered by JetHome®