NetBSD-Bugs archive

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

Re: port-xen/54273: "zpool create pool xbd2" panics DOMU kernel



The following reply was made to PR port-xen/54273; 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: port-xen/54273: "zpool create pool xbd2" panics DOMU kernel
Date: Fri, 7 Jun 2019 17:25:55 +0200

 --Apple-Mail=_9C6087D7-48D4-4178-8004-6A2C5146CA3E
 Content-Type: multipart/mixed;
 	boundary="Apple-Mail=_76D7F7A7-D423-4C90-88BD-B93A3CC03BA7"
 
 
 --Apple-Mail=_76D7F7A7-D423-4C90-88BD-B93A3CC03BA7
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Looks like a MAXPHYS issue, please try the attached diff.
 
 --
 J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig
 
 
 --Apple-Mail=_76D7F7A7-D423-4C90-88BD-B93A3CC03BA7
 Content-Disposition: attachment;
 	filename=vd_maxphys.diff
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="vd_maxphys.diff"
 Content-Transfer-Encoding: 7bit
 
 vd_maxphys
 
 Try to retrieve the per-disk maximum transfer size and use it instead
 of MAXPHYS.  Eagerly waiting for the merge of tls-maxphys.
 
 diff -r 008151456b52 -r c1c8cf0fb84d external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev_disk.h
 --- external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev_disk.h
 +++ external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev_disk.h
 @@ -52,6 +52,7 @@ typedef struct vdev_disk {
  	char            *vd_minor;
  	vnode_t         *vd_vp;
  	struct workqueue *vd_wq;
 +	int		vd_maxphys;
  #endif
  } vdev_disk_t;
  #endif
 diff -r 008151456b52 -r c1c8cf0fb84d external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
 --- external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
 +++ external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
 @@ -219,6 +219,27 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi
  		return (SET_ERROR(EINVAL));
  	}
  
 +	/* XXXNETBSD Once tls-maxphys gets merged this block becomes:
 +		pdk = disk_find_blk(vp->v_rdev);
 +		dvd->vd_maxphys = (pdk ? disk_maxphys(pdk) : MACHINE_MAXPHYS);
 +	*/
 +	{
 +		struct buf buf = { b_bcount: MAXPHYS };
 +		const char *dev_name;
 +
 +		dev_name = devsw_blk2name(major(vp->v_rdev));
 +		if (dev_name) {
 +			char disk_name[16];
 +
 +			snprintf(disk_name, sizeof(disk_name), "%s%d",
 +			    dev_name, DISKUNIT(vp->v_rdev));
 +			pdk = disk_find(disk_name);
 +			if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys)
 +				(*pdk->dk_driver->d_minphys)(&buf);
 +		}
 +		dvd->vd_maxphys = buf.b_bcount;
 +	}
 +
  	/*
  	 * XXXNETBSD Compare the devid to the stored value.
  	 */
 @@ -421,6 +442,7 @@ vdev_disk_io_start(zio_t *zio)
  		zio_interrupt(zio);
  		return;
  	}
 +	ASSERT3U(dvd->vd_maxphys, >, 0);
  	vp = dvd->vd_vp;
  #endif
  
 @@ -473,7 +495,7 @@ vdev_disk_io_start(zio_t *zio)
  		mutex_exit(vp->v_interlock);
  	}
  
 -	if (bp->b_bcount <= MAXPHYS) {
 +	if (bp->b_bcount <= dvd->vd_maxphys) {
  		/* We can do this I/O in one pass. */
  		(void)VOP_STRATEGY(vp, bp);
  	} else {
 @@ -484,7 +506,7 @@ vdev_disk_io_start(zio_t *zio)
  		resid = zio->io_size;
  		off = 0;
  		while (resid != 0) {
 -			size = uimin(resid, MAXPHYS);
 +			size = uimin(resid, dvd->vd_maxphys);
  			nbp = getiobuf(vp, true);
  			nbp->b_blkno = btodb(zio->io_offset + off);
  			/* Below call increments v_numoutput. */
 
 --Apple-Mail=_76D7F7A7-D423-4C90-88BD-B93A3CC03BA7--
 
 --Apple-Mail=_9C6087D7-48D4-4178-8004-6A2C5146CA3E
 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+uEFAlz6ggMACgkQKoaVJdNr
 +uFBGAf/cvBVF9zxzGnpGKqKrmobUaz+4EBwC9FTZxf/3VrqRobO59REsM804cnE
 eP2Xsdc8zbmHKmHBWsni4uH8DywF74IX5hr9o/LIAY+BbcSnDGxhiy9pCtqLKdBd
 RlnRShuABsL044qw2Dpszzq+gW7GD94ekjYTpsukITI/YXf0Ujljz1cObOcuhzhc
 yehkgwH7kmD8Q/Oef525/OLKb6tEas6/AvVsJhsTGqNGY3/8BGJYu55KMV7GunfT
 5bPU76qGFummeGBaMbe23YCT3Zd/WncLHOrQroosDwY4vBMcTFe96Xi/VXssBJSx
 dNWNxCkpkOog48TNVoMTo25O08JDCA==
 =CRcn
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_9C6087D7-48D4-4178-8004-6A2C5146CA3E--
 


Home | Main Index | Thread Index | Old Index