Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs in nfs_writerpc(), avoid a signed/unsigned problem i...



details:   https://anonhg.NetBSD.org/src/rev/4a0fc6bbf601
branches:  trunk
changeset: 808351:4a0fc6bbf601
user:      chs <chs%NetBSD.org@localhost>
date:      Thu May 14 17:35:54 2015 +0000

description:
in nfs_writerpc(), avoid a signed/unsigned problem in computing the
number of bytes to back up in the uio when we need to resend a write RPC
(eg. after a server crash) on a 64-bit platform.  should fix PR 35448.

diffstat:

 sys/nfs/nfs_vnops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6ad8aa8ad889 -r 4a0fc6bbf601 sys/nfs/nfs_vnops.c
--- a/sys/nfs/nfs_vnops.c       Thu May 14 17:31:24 2015 +0000
+++ b/sys/nfs/nfs_vnops.c       Thu May 14 17:35:54 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vnops.c,v 1.307 2015/04/20 23:03:09 riastradh Exp $        */
+/*     $NetBSD: nfs_vnops.c,v 1.308 2015/05/14 17:35:54 chs Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.307 2015/04/20 23:03:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.308 2015/05/14 17:35:54 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -1311,7 +1311,7 @@
        byte_count = 0; /* count of bytes actually written */
        while (tsiz > 0) {
                uint32_t datalen; /* data bytes need to be allocated in mbuf */
-               uint32_t backup;
+               size_t backup;
                bool stalewriteverf = false;
 
                nfsstats.rpccnt[NFSPROC_WRITE]++;



Home | Main Index | Thread Index | Old Index