Hi. I''m pondering this piece of mappedwrite(): if (pp = page_lookup(vp, start, SE_SHARED)) { caddr_t va; rw_exit(&zp->z_map_lock); va = ppmapin(pp, PROT_READ | PROT_WRITE, (caddr_t)-1L); error = uiomove(va+off, bytes, UIO_WRITE, uio); if (error == 0) { dmu_write(zfsvfs->z_os, zp->z_id, woff, bytes, va+off, tx); } ppmapout(va); page_unlock(pp); [...] In FreeBSD I call dmu_write() unconditionally, because if uiomove() partially succeeds, we will lose the change. If uiomove() fails entirely, well, we just write what we got before one more time. Is it also the case for OpenSolaris? -- Pawel Jakub Dawidek http://www.wheel.pl pjd at FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/zfs-code/attachments/20070501/2db196a4/attachment.bin>
Yes, its the same in Solaris. Its probably more correct to always to do the dmu_write() as this keeps the page and file in sync. -Mark Pawel Jakub Dawidek wrote:> Hi. > > I''m pondering this piece of mappedwrite(): > > if (pp = page_lookup(vp, start, SE_SHARED)) { > caddr_t va; > > rw_exit(&zp->z_map_lock); > va = ppmapin(pp, PROT_READ | PROT_WRITE, (caddr_t)-1L); > error = uiomove(va+off, bytes, UIO_WRITE, uio); > if (error == 0) { > dmu_write(zfsvfs->z_os, zp->z_id, > woff, bytes, va+off, tx); > } > ppmapout(va); > page_unlock(pp); > [...] > > In FreeBSD I call dmu_write() unconditionally, because if uiomove() > partially succeeds, we will lose the change. If uiomove() fails > entirely, well, we just write what we got before one more time. > Is it also the case for OpenSolaris? > > > > ------------------------------------------------------------------------ > > _______________________________________________ > zfs-code mailing list > zfs-code at opensolaris.org > http://opensolaris.org/mailman/listinfo/zfs-code