Source-Changes-HG archive

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

[src/netbsd-6-1]: src/sys/nfs Pull up following revision(s) (requested by han...



details:   https://anonhg.NetBSD.org/src/rev/93867955aa76
branches:  netbsd-6-1
changeset: 775831:93867955aa76
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Sep 07 16:08:28 2013 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #933):
        sys/nfs/nfs_bio.c: revision 1.189
Function nfs_vinvalbuf() ignores errors from vinvalbuf() and therefore
delayed write errors may get lost.
Change nfs_vinvalbuf() to keep errors from vinvalbuf() for fsync() or =
close().
=20
Presented on tech-kern@
=20
Fix for PR kern/47980 (NFS over-quota not detected if utimes() called
before fsync()/close())
=20
=20

diffstat:

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

diffs (50 lines):

diff -r 86922c0aa672 -r 93867955aa76 sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Sat Sep 07 16:01:28 2013 +0000
+++ b/sys/nfs/nfs_bio.c Sat Sep 07 16:08:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_bio.c,v 1.188 2011/09/27 01:07:38 christos Exp $   */
+/*     $NetBSD: nfs_bio.c,v 1.188.22.1 2013/09/07 16:08:28 bouyer Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.188 2011/09/27 01:07:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.188.22.1 2013/09/07 16:08:28 bouyer Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -614,7 +614,7 @@
 {
        struct nfsnode *np = VTONFS(vp);
        struct nfsmount *nmp = VFSTONFS(vp->v_mount);
-       int error = 0, slptimeo;
+       int error = 0, allerror = 0, slptimeo;
        bool catch;
 
        if ((nmp->nm_flag & NFSMNT_INT) == 0)
@@ -647,6 +647,8 @@
        mutex_exit(vp->v_interlock);
        error = vinvalbuf(vp, flags, cred, l, catch, 0);
        while (error) {
+               if (allerror == 0)
+                       allerror = error;
                if (intrflg && nfs_sigintr(nmp, NULL, l)) {
                        error = EINTR;
                        break;
@@ -654,6 +656,13 @@
                error = vinvalbuf(vp, flags, cred, l, 0, slptimeo);
        }
        mutex_enter(vp->v_interlock);
+       if (allerror != 0) {
+               /*
+                * Keep error from vinvalbuf so fsync/close will know.
+                */
+               np->n_error = allerror;
+               np->n_flag |= NWRITEERR;
+       }
        if (error == 0)
                np->n_flag &= ~NMODIFIED;
        np->n_flag &= ~NFLUSHINPROG;



Home | Main Index | Thread Index | Old Index