NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/54598: mount ntfs panic



The following reply was made to PR kern/54598; it has been noted by GNATS.

From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/54598: mount ntfs panic
Date: Tue, 8 Oct 2019 17:27:45 +0200

 --Apple-Mail=_A9636ED6-63D7-470E-8BD2-92E659ED4D07
 Content-Type: multipart/mixed;
 	boundary="Apple-Mail=_85111805-9127-466E-A614-995DB4BC4CA3"
 
 
 --Apple-Mail=_85111805-9127-466E-A614-995DB4BC4CA3
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 > On 8. Oct 2019, at 16:35, Patrick Welche <prlw1%cam.ac.uk@localhost> wrote:
 <snip>
 > 
 > It appears to already be the first one. (no panics though)
 
 Part of ntfs_subr.c Rev. 1.52 looks suspect.  Please try
 after the first commit with the attached diff reversed.
 
 --
 J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig
 
 
 --Apple-Mail=_85111805-9127-466E-A614-995DB4BC4CA3
 Content-Disposition: attachment;
 	filename=ntfs_subr.c.diff
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="ntfs_subr.c.diff"
 Content-Transfer-Encoding: 7bit
 
 --- ntfs_subr.c	28 Jun 2013 17:13:34 -0000	1.51
 +++ ntfs_subr.c	13 Nov 2014 16:49:56 -0000	1.52
 @@ -275,5 +275,4 @@ ntfs_loadntnode(
  {
  	struct filerec  *mfrp;
 -	daddr_t         bn;
  	int		error,off;
  	struct attr    *ap;
 @@ -287,12 +286,19 @@ ntfs_loadntnode(
  	if (ip->i_number < NTFS_SYSNODESNUM) {
  		struct buf     *bp;
 +		daddr_t         bn;
 +		off_t           boff;
  
  		dprintf(("%s: read system node\n", __func__));
  
 -		bn = ntfs_cntobn(ntmp->ntm_mftcn) +
 -			ntmp->ntm_bpmftrec * ip->i_number;
 +		/*
 +		 * Make sure we always read full cluster to
 +		 * prevent buffer cache inconsistency.
 +		 */
 +		boff = ntfs_cntob(ntmp->ntm_mftcn) +
 +		    ntfs_bntob(ntmp->ntm_bpmftrec) * ip->i_number;
 +		bn = ntfs_cntobn(ntfs_btocn(boff));
 +		off = ntfs_btocnoff(boff);
  
 -		error = bread(ntmp->ntm_devvp,
 -			      bn, ntfs_bntob(ntmp->ntm_bpmftrec),
 +		error = bread(ntmp->ntm_devvp, bn, ntfs_cntob(1),
  			      NOCRED, 0, &bp);
  		if (error) {
 @@ -300,5 +306,6 @@ ntfs_loadntnode(
  			goto out;
  		}
 -		memcpy(mfrp, bp->b_data, ntfs_bntob(ntmp->ntm_bpmftrec));
 +		memcpy(mfrp, (char *)bp->b_data + off,
 +		    ntfs_bntob(ntmp->ntm_bpmftrec));
  		bqrelse(bp);
  	} else {
 
 --Apple-Mail=_85111805-9127-466E-A614-995DB4BC4CA3--
 
 --Apple-Mail=_A9636ED6-63D7-470E-8BD2-92E659ED4D07
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP
 
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAEBCAAdFiEE2BL3ha7Xao4WUZVYKoaVJdNr+uEFAl2cqvEACgkQKoaVJdNr
 +uE4Ngf/fRVcRrbuLZnlEUGFV3SONdDEPz07+Z4AK5AKKFe+sbJQd20cw1RyqJLu
 WzFiJE+45Si4JDeARQtGVbuf/Ix3GNS+/5tT1MBYIwTNKUvqXX9EFRDUjCRNHz/m
 mMPjjKE1s9Sfd5XQXBjj3/Symahxb+Q59QkNUo/FDEMO2kNFu5E0kH0qlPU878xj
 7qbTf50s3sXuPqHWLXL86bGCPGrJC/RmYY4wMb9jq6zp29wEnMfNDEabSte+LJ68
 9nAsGwctvNK4eHW1aNIO0VOycd4L88rKTIN6EDvjpHG2Utq/MT5TtNEwUY/h5RAl
 fBpRAylSfgwuSXa6q37ht2V6O/HV2A==
 =miP4
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_A9636ED6-63D7-470E-8BD2-92E659ED4D07--
 


Home | Main Index | Thread Index | Old Index