[TEST] NTFS patch

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Sun, 12 Dec 2004 12:25:55 +0100
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
_at__at_ -333,7 +333,10 _at__at_
 	/* 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
_at__at_ -97,9 +97,14 _at__at_
 		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_at_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.
Received on Sun Dec 12 2004 - 10:25:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:24 UTC