Project

General

Profile

Bug #5471 ยป zvol_uio_loffset.patch

Steven Hartland, 2014-12-23 09:10 AM

View differences:

usr/src/uts/common/fs/zfs/zvol.c
1384 1384
		return (SET_ERROR(ENXIO));
1385 1385

  
1386 1386
	volsize = zv->zv_volsize;
1387
	 /* uio_loffset == volsize isn't an error as its required for EOF processing. */
1387 1388
	if (uio->uio_resid > 0 &&
1388
	    (uio->uio_loffset < 0 || uio->uio_loffset >= volsize))
1389
	    (uio->uio_loffset < 0 || uio->uio_loffset > volsize))
1389 1390
		return (SET_ERROR(EIO));
1390 1391

  
1391 1392
	if (zv->zv_flags & ZVOL_DUMPIFIED) {
......
1431 1432
		return (SET_ERROR(ENXIO));
1432 1433

  
1433 1434
	volsize = zv->zv_volsize;
1435
	/* uio_loffset == volsize isn't an error as its required for EOF processing. */
1434 1436
	if (uio->uio_resid > 0 &&
1435
	    (uio->uio_loffset < 0 || uio->uio_loffset >= volsize))
1437
	    (uio->uio_loffset < 0 || uio->uio_loffset > volsize))
1436 1438
		return (SET_ERROR(EIO));
1437 1439

  
1438 1440
	if (zv->zv_flags & ZVOL_DUMPIFIED) {
    (1-1/1)