Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs fix a couple more bugs:



details:   https://anonhg.NetBSD.org/src/rev/7f301e1c0420
branches:  trunk
changeset: 503939:7f301e1c0420
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Feb 18 15:52:32 2001 +0000

description:
fix a couple more bugs:
 - in nfs_getpages(), unbusy any pages that we don't free in the error path.
 - in nfs_putpages(), only call biowait() if we actually started any i/os.

diffstat:

 sys/nfs/nfs_bio.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 61e532f2894f -r 7f301e1c0420 sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Sun Feb 18 15:03:42 2001 +0000
+++ b/sys/nfs/nfs_bio.c Sun Feb 18 15:52:32 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_bio.c,v 1.61 2001/02/05 12:27:18 chs Exp $ */
+/*     $NetBSD: nfs_bio.c,v 1.62 2001/02/18 15:52:32 chs Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -1298,7 +1298,11 @@
                        }
                        if (pgs[i]->flags & PG_FAKE) {
                                uvm_pagefree(pgs[i]);
+                               continue;
                        }
+                       uvm_pageactivate(pgs[i]);
+                       pgs[i]->flags &= ~(PG_WANTED|PG_BUSY);
+                       UVM_PAGE_OWN(pgs[i], NULL);
                }
                uvm_unlock_pageq();
                simple_unlock(&uobj->vmobjlock);
@@ -1369,7 +1373,7 @@
        struct vm_page **pgs = ap->a_m;
        int flags = ap->a_flags;
        int npages = ap->a_count;
-       int s, error = 0, i;
+       int s, error, i;
        size_t bytes, iobytes, skipbytes;
        vaddr_t kva;
        off_t offset, origoffset, commitoff;
@@ -1384,6 +1388,7 @@
 
        simple_unlock(&vp->v_uvm.u_obj.vmobjlock);
 
+       error = 0;
        origoffset = pgs[0]->offset;
        bytes = MIN(ap->a_count << PAGE_SHIFT, vp->v_uvm.u_size - origoffset);
        skipbytes = 0;
@@ -1490,7 +1495,9 @@
        if (async) {
                return EINPROGRESS;
        }
-       error = biowait(mbp);
+       if (bp != NULL) {
+               error = biowait(mbp);
+       }
 
        s = splbio();
        vwakeup(mbp);



Home | Main Index | Thread Index | Old Index