From owner-freebsd-current@FreeBSD.ORG Sun Dec 12 11:25:59 2004 Return-Path: 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 C841B16A4CE for ; Sun, 12 Dec 2004 11:25:59 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9DDE43D1D for ; Sun, 12 Dec 2004 11:25:58 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id iBCBPtL6012005 for ; Sun, 12 Dec 2004 12:25:55 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: current@freebsd.org From: Poul-Henning Kamp Date: Sun, 12 Dec 2004 12:25:55 +0100 Message-ID: <12004.1102850755@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Subject: [TEST] NTFS patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2004 11:25:59 -0000 Here is a combined patch for the two problems that's been reported against NTFS after my mount changes. Please test & report. Index: fs/ntfs/ntfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/ntfs/ntfs_vfsops.c,v retrieving revision 1.70 diff -u -r1.70 ntfs_vfsops.c --- fs/ntfs/ntfs_vfsops.c 6 Dec 2004 20:22:16 -0000 1.70 +++ fs/ntfs/ntfs_vfsops.c 12 Dec 2004 11:23:45 -0000 @@ -333,7 +333,10 @@ /* Copy in the 8-bit to Unicode conversion table */ /* Initialize Unicode to 8-bit table from 8toU table */ ntfs_82u_init(ntmp, cs_local, cs_ntfs); - ntfs_u28_init(ntmp, NULL, cs_local, cs_ntfs); + if (cs_local != NULL && cs_ntfs != NULL) + ntfs_u28_init(ntmp, NULL, cs_local, cs_ntfs); + else + ntfs_u28_init(ntmp, ntmp->ntm_82u, cs_local, cs_ntfs); mp->mnt_data = (qaddr_t)ntmp; Index: fs/ntfs/ntfs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/ntfs/ntfs_vnops.c,v retrieving revision 1.46 diff -u -r1.46 ntfs_vnops.c --- fs/ntfs/ntfs_vnops.c 1 Dec 2004 23:16:33 -0000 1.46 +++ fs/ntfs/ntfs_vnops.c 12 Dec 2004 11:23:45 -0000 @@ -97,9 +97,14 @@ int *a_runb; } */ *ap; { + struct vnode *vp = ap->a_vp; + struct fnode *fp = VTOF(vp); + struct ntnode *ip = FTONT(fp); + struct ntfsmount *ntmp = ip->i_mp; + dprintf(("ntfs_bmap: vn: %p, blk: %d\n", ap->a_vp,(u_int32_t)ap->a_bn)); if (ap->a_bop != NULL) - *ap->a_bop = &ap->a_vp->v_bufobj; + *ap->a_bop = &ntmp->ntm_devvp->v_bufobj; if (ap->a_bnp != NULL) *ap->a_bnp = ap->a_bn; if (ap->a_runp != NULL) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.