Source-Changes archive

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

Re: CVS commit: src/sys/rump/fs/lib/libnfs



In article <20081016190640.18BBF175D0%cvs.netbsd.org@localhost>,
Antti Kantee  <pooka%netbsd.org@localhost> wrote:
>
>Module Name:   src
>Committed By:  pooka
>Date:          Thu Oct 16 19:06:40 UTC 2008
>
>Modified Files:
>       src/sys/rump/fs/lib/libnfs: Makefile
>
>Log Message:
>Ignore stack-protector, since with nfs_bio.c it gets its life force
>drained out.  Yes, this is a quick kludge, should rather fix
>nfs_bio.c to be less silly.
>
>
>To generate a diff of this commit:
>cvs rdiff -r1.5 -r1.6 src/sys/rump/fs/lib/libnfs/Makefile
>
>Please note that diffs are not public domain; they are subject to the
>copyright notices on the relevant files.
>
>

Why not just this?

christos

Index: nfs_bio.c
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfs_bio.c,v
retrieving revision 1.175
diff -u -u -r1.175 nfs_bio.c
--- nfs_bio.c   24 Apr 2008 15:35:31 -0000      1.175
+++ nfs_bio.c   16 Oct 2008 19:26:51 -0000
@@ -921,7 +921,7 @@
        int iomode;
        bool stalewriteverf = false;
        int i, npages = (bp->b_bcount + PAGE_SIZE - 1) >> PAGE_SHIFT;
-       struct vm_page *pgs[npages];
+       struct vm_page *pgs;
 #ifndef NFS_V2_ONLY
        bool needcommit = true; /* need only COMMIT RPC */
 #else
@@ -938,6 +938,8 @@
                iomode = NFSV3WRITE_FILESYNC;
        }
 
+       pgs = malloc(sizeof(*pgs) * npages, M_TEMP, M_WAITOK);
+
 #ifndef NFS_V2_ONLY
 again:
 #endif
@@ -1046,7 +1048,7 @@
                        bp->b_error = np->n_error = error;
                        np->n_flag |= NWRITEERR;
                }
-               return error;
+               goto out;
        }
 #endif
        off = uiop->uio_offset;
@@ -1115,6 +1117,8 @@
        if (stalewriteverf) {
                nfs_clearcommit(vp->v_mount);
        }
+out:
+       free(pgs, M_TEMP);
        return error;
 }
 



Home | Main Index | Thread Index | Old Index