Bug 69446

Summary: [PATCH] UFS blocksize bug
Product: [Retired] Red Hat Linux Reporter: Martin <mkamm>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-08 16:31:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin 2002-07-22 17:16:56 UTC
Description of Problem:
The UFS filesystem of kernel-2.4.18 works quite well (at least in RO
mode) but there is a bug (oversight) in linux/fs/ufs/super.c that
prevents UFS filesystems with a block size of 16K from being
mounted. (4K, 8K, 32K are working).

Between Redhat kernel-2.4.18-3 and kernel-2.4.18-5 ufs/super.c was
patched to make things worse. A small patch inside the jumbo patch
file redhat/SOURCES/linux-2.4.17-selected-ac-bits.patch tries to do
the right thing but consistently confuses block size with fragment
size.

Apply the following patch to correct this miscarried patch. I have
this patch running for quite a while and mount 8K/1K and 16K/2K UFS
filesystems.

HTH Martin


diff -urN linux/fs/ufs/super.c linux-ufs/fs/ufs/super.c
--- linux/fs/ufs/super.c	Mon Jun 10 20:51:36 2002
+++ linux-ufs/fs/ufs/super.c	Wed Jul 17 17:35:44 2002
@@ -662,12 +662,12 @@
 			uspi->s_fsize);
 		goto failed;
 	}
-	if (uspi->s_bsize < 512) {
+	if (uspi->s_fsize < 512) {
 		printk(KERN_ERR "ufs_read_super: fragment size %u is too small\n",
 			uspi->s_fsize);
 		goto failed;
 	}
-	if (uspi->s_bsize > 4096) {
+	if (uspi->s_fsize > 4096) {
 		printk(KERN_ERR "ufs_read_super: fragment size %u is too large\n",
 			uspi->s_fsize);
 		goto failed;
@@ -679,7 +679,7 @@
 	}
 	if (uspi->s_bsize < 4096) {
 		printk(KERN_ERR "ufs_read_super: block size %u is too small\n",
-			uspi->s_fsize);
+			uspi->s_bsize);
 		goto failed;
 	}
 	if (uspi->s_bsize / uspi->s_fsize > 8) {



Version-Release number of selected component (if applicable):
see above

How Reproducible:
mount -t ufs <any ufs with blocksize != 4k>