kern/84637: GEOM LABEL sometimes doesn't recognize labels on UFS1 parts

Stanislav Sedov stas at 310.ru
Sun Aug 7 05:30:20 GMT 2005


>Number:         84637
>Category:       kern
>Synopsis:       GEOM LABEL sometimes doesn't recognize labels on UFS1 parts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 07 05:30:18 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Stanislav Sedov
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
310.ru [Tridesyatoe]
>Environment:
System: FreeBSD stalingrad.realnet 7.0-CURRENT FreeBSD 7.0-CURRENT #96: Thu Jul 28 21:05:39 UTC 2005 root at stalingrad.realnet:/work/src/fbsd-cur/src/sys/i386/compile/DESKTOP i386


	
>Description:
	GEOM label class doesn't recognize labels on UFS partitions where 
mediasize % fragsize != 0.
>How-To-Repeat:
	
>Fix:

	

--- g_label_ufs.c.diff begins here ---
--- g_label_ufs.c.orig	Mon Jul 25 13:42:13 2005
+++ g_label_ufs.c	Mon Jul 25 13:33:29 2005
@@ -78,8 +78,8 @@
 		if (fs->fs_magic == FS_UFS1_MAGIC) {
 			G_LABEL_DEBUG(1, "UFS1 file system detected on %s.",
 			    pp->name);
-			if (fs->fs_old_size * fs->fs_fsize !=
-			    (int32_t)pp->mediasize) {
+			if (fs->fs_fsize <= 0 || 
+			    pp->mediasize / fs->fs_fsize != fs->fs_old_size) {
 				G_LABEL_DEBUG(1, "Incorrect superblock " \
 				    "parameters on %s.", pp->name);
 				g_free(fs);
@@ -90,6 +90,8 @@
 			    pp->name);
 			if (fs->fs_fsize <= 0 ||
 			    pp->mediasize / fs->fs_fsize != fs->fs_size) {
+				G_LABEL_DEBUG(1, "Incorrect superblock " \
+				    "parameters on %s.", pp->name);
 				g_free(fs);
 				continue;
 			}
--- g_label_ufs.c.diff ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list