Source-Changes-HG archive

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

[src/netbsd-7]: src/lib/libperfuse Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/a7dc125e42f0
branches:  netbsd-7
changeset: 798339:a7dc125e42f0
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 11 13:41:57 2014 +0000

description:
Pull up following revision(s) (requested by manu in ticket #89):
        lib/libperfuse/ops.c: revision 1.74
Avoid a file resize serialization deadlock when writing with
PUFFS_IO_APPEND flag. The symptom was a hang when appending to
a file with a null size.

diffstat:

 lib/libperfuse/ops.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (43 lines):

diff -r 757c0cc7761a -r a7dc125e42f0 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Thu Sep 11 13:06:03 2014 +0000
+++ b/lib/libperfuse/ops.c      Thu Sep 11 13:41:57 2014 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.66.2.4 2014/09/11 12:17:10 martin Exp $ */
+/*  $NetBSD: ops.c,v 1.66.2.5 2014/09/11 13:41:57 martin Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -3198,16 +3198,6 @@
                requeue_request(pu, opc, PCQ_WRITE);
        pnd->pnd_flags |= PND_INWRITE;
 
-       /* 
-        * Serialize size access, see comment in perfuse_node_setattr().
-        */
-       if ((u_quad_t)offset + *resid > vap->va_size) {
-               while (pnd->pnd_flags & PND_INRESIZE)
-                       requeue_request(pu, opc, PCQ_RESIZE);
-               pnd->pnd_flags |= PND_INRESIZE;
-               inresize = 1;
-       }
-
        /*
         * append flag: re-read the file size so that 
         * we get the latest value.
@@ -3219,6 +3209,16 @@
                offset = vap->va_size;
        }
 
+       /* 
+        * Serialize size access, see comment in perfuse_node_setattr().
+        */
+       if ((u_quad_t)offset + *resid > vap->va_size) {
+               while (pnd->pnd_flags & PND_INRESIZE)
+                       requeue_request(pu, opc, PCQ_RESIZE);
+               pnd->pnd_flags |= PND_INRESIZE;
+               inresize = 1;
+       }
+
 #ifdef PERFUSE_DEBUG
        if (perfuse_diagflags & PDF_RESIZE)
                DPRINTF(">> %s %p %" PRIu64 "\n", __func__,



Home | Main Index | Thread Index | Old Index