From owner-freebsd-current Sun Oct 13 8:52:30 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89ACD37B401 for ; Sun, 13 Oct 2002 08:52:29 -0700 (PDT) Received: from mail02.svc.cra.dublin.eircom.net (mail02.svc.cra.dublin.eircom.net [159.134.118.18]) by mx1.FreeBSD.org (Postfix) with SMTP id 8D64443E7B for ; Sun, 13 Oct 2002 08:52:28 -0700 (PDT) (envelope-from pmedwards@eircom.net) Received: (qmail 76480 messnum 32877 invoked from network[159.134.237.77/kearney.eircom.net]); 13 Oct 2002 15:52:27 -0000 Received: from kearney.eircom.net (HELO webmail.eircom.net) (159.134.237.77) by mail02.svc.cra.dublin.eircom.net (qp 76480) with SMTP; 13 Oct 2002 15:52:27 -0000 From: "Peter Edwards" To: current@freebsd.org Subject: Bug unmounting readonly NTFS partitions uncovered by GEOM Date: Sun, 13 Oct 2002 16:50:22 +0100 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Originating-IP: 194.125.181.215 X-Mailer: Eircom Net CRC Webmail (http://www.eircom.net/) Organization: Eircom Net (http://www.eircom.net/) Message-Id: <20021013155228.8D64443E7B@mx1.FreeBSD.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ntfs_unmount has had this bug since v 1.1: there's a "ronly" variable that should be used to detect if the mount is read-only and affect the flags passed to the VOP_CLOSE of the device vnode accordingly. It's never set to anything other than zero, but the matching VOP_OPEN in ntfs_mount() gets it right. GEOM notices the mismatch between the VOP_OPEN and VOP_CLOSE on the device, and panics in g_access_rel() when unmounting a read-only mounted NTFS partition. Does someone want to commit the obvious patch? petere@celery$ cvs -R diff -u sys/fs/ntfs cvs diff: Diffing sys/fs/ntfs Index: sys/fs/ntfs/ntfs_vfsops.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/sys/fs/ntfs/ntfs_vfsops.c,v retrieving revision 1.47 diff -u -r1.47 ntfs_vfsops.c --- sys/fs/ntfs/ntfs_vfsops.c 27 Sep 2002 18:27:06 -0000 1.47 +++ sys/fs/ntfs/ntfs_vfsops.c 13 Oct 2002 15:30:01 -0000 @@ -508,6 +508,7 @@ vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, td, 0, 0); + ronly = (mp->mnt_flag & MNT_RDONLY) != 0; error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, td); -- Peter Edwards To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message