Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2002 20:12:21 +0100 (CET)
From:      Thomas Quinot <thomas@cuivre.fr.eu.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/36309: [patch] Wrong mnt_iosize_max calculation in FFS
Message-ID:  <20020325191221.58E0F2C3D1@melusine.cuivre.fr.eu.org>

next in thread | raw e-mail | index | archive | help

>Number:         36309
>Category:       kern
>Synopsis:       [patch] Wrong mnt_iosize_max calculation in FFS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 25 11:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Quinot
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD melusine.cuivre.fr.eu.org 4.5-STABLE FreeBSD 4.5-STABLE #1: Mon Mar 25 09:55:16 CET 2002 root@melusine.cuivre.fr.eu.org:/usr2/obj/usr2/src/sys/MELUSINE i386


	
>Description:
	When mounting an FFS file system, the mnt_iosize_max
	attribute of the mount point is supposed to be set to
	a value no greater than the si_iosize_max of the underlying
	device, but the comparison between the two values is
	made in the wrong direction.

	The consequence is that, in some circumstances, IO requests
	to a device may be made with a size that exceeds its
	si_iosize_max.
>How-To-Repeat:

>Fix:

	The patch below seems to fix the problem for me.

Index: sys/ufs/ffs/ffs_vfsops.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v
retrieving revision 1.172
diff -u -r1.172 ffs_vfsops.c
--- sys/ufs/ffs/ffs_vfsops.c	19 Mar 2002 22:40:47 -0000	1.172
+++ sys/ufs/ffs/ffs_vfsops.c	25 Mar 2002 18:59:32 -0000
@@ -603,7 +603,7 @@
 	VOP_UNLOCK(devvp, 0, td);
 	if (error)
 		return (error);
-	if (devvp->v_rdev->si_iosize_max > mp->mnt_iosize_max)
+	if (mp->mnt_iosize_max > devvp->v_rdev->si_iosize_max)
 		mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max;
 	if (mp->mnt_iosize_max > MAXPHYS)
 		mp->mnt_iosize_max = MAXPHYS;

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020325191221.58E0F2C3D1>