summaryrefslogtreecommitdiffstats
path: root/sys/netsmb
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2002-02-21 16:18:39 +0000
committerbp <bp@FreeBSD.org>2002-02-21 16:18:39 +0000
commit5829508a14d782a246c4c7bf4c1afbc6c26e2da1 (patch)
tree4a4b65b356e11edcd3f09fc69c1aa843aa15c767 /sys/netsmb
parent6657ab0f302bf23966a3def9c684511943311d8a (diff)
downloadFreeBSD-src-5829508a14d782a246c4c7bf4c1afbc6c26e2da1.zip
FreeBSD-src-5829508a14d782a246c4c7bf4c1afbc6c26e2da1.tar.gz
Remove redundant checks for iovcnt > 1. This should be handled properly
in the subr_mchain. Obtained from: Darwin project MFC after: 2 weeks
Diffstat (limited to 'sys/netsmb')
-rw-r--r--sys/netsmb/smb_smb.c14
1 files changed, 7 insertions, 7 deletions
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;
OpenPOWER on IntegriCloud