From owner-freebsd-bugs Mon Mar 25 11:20:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id AE28C37B41B for ; Mon, 25 Mar 2002 11:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2PJK1k81614; Mon, 25 Mar 2002 11:20:01 -0800 (PST) (envelope-from gnats) Received: from melchior.cuivre.fr.eu.org (melchior.enst.fr [137.194.161.6]) by hub.freebsd.org (Postfix) with ESMTP id 68A9237B440 for ; Mon, 25 Mar 2002 11:12:24 -0800 (PST) Received: from melusine.cuivre.fr.eu.org (melusine.enst.fr [137.194.160.34]) by melchior.cuivre.fr.eu.org (Postfix) with ESMTP id 669F489F1 for ; Mon, 25 Mar 2002 20:12:22 +0100 (CET) Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000) id 58E0F2C3D1; Mon, 25 Mar 2002 20:12:21 +0100 (CET) Message-Id: <20020325191221.58E0F2C3D1@melusine.cuivre.fr.eu.org> Date: Mon, 25 Mar 2002 20:12:21 +0100 (CET) From: Thomas Quinot Reply-To: Thomas Quinot To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/36309: [patch] Wrong mnt_iosize_max calculation in FFS Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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