From 5829508a14d782a246c4c7bf4c1afbc6c26e2da1 Mon Sep 17 00:00:00 2001 From: bp Date: Thu, 21 Feb 2002 16:18:39 +0000 Subject: Remove redundant checks for iovcnt > 1. This should be handled properly in the subr_mchain. Obtained from: Darwin project MFC after: 2 weeks --- sys/netsmb/smb_smb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/netsmb') diff --git a/sys/netsmb/smb_smb.c b/sys/netsmb/smb_smb.c index 6d07d34..6b9b2cc 100644 --- a/sys/netsmb/smb_smb.c +++ b/sys/netsmb/smb_smb.c @@ -618,13 +618,6 @@ smb_write(struct smb_share *ssp, u_int16_t fid, struct uio *uio, int error = 0, len, tsize, resid; struct uio olduio; - /* - * review: manage iov more precisely - */ - if (uio->uio_iovcnt != 1) { - SMBERROR("can't handle iovcnt > 1\n"); - return EIO; - } tsize = uio->uio_resid; olduio = *uio; while (tsize > 0) { @@ -639,6 +632,13 @@ smb_write(struct smb_share *ssp, u_int16_t fid, struct uio *uio, tsize -= resid; } if (error) { + /* + * Errors can happen on the copyin, the rpc, etc. So they + * imply resid is unreliable. The only safe thing is + * to pretend zero bytes made it. We needn't restore the + * iovs because callers don't depend on them in error + * paths - uio_resid and uio_offset are what matter. + */ *uio = olduio; } return error; -- cgit v1.1