Source-Changes-HG archive

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

[src/netbsd-6]: src/lib/librefuse Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/b65187a2ebea
branches:  netbsd-6
changeset: 775613:b65187a2ebea
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Jan 07 15:54:00 2013 +0000

description:
Pull up following revision(s) (requested by tron in ticket #772):
        lib/librefuse/refuse.c: revision 1.96
FUSE seems to allow short writes without errors but PUFFS doesn't. Work
around this by returning ENOSPC in case of a short write to avoid protocol
errors. This change is based on problem analysis provided by Antti Kantee.
This fixes PR lib/45129 by myself.

diffstat:

 lib/librefuse/refuse.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 5dc78b4b5887 -r b65187a2ebea lib/librefuse/refuse.c
--- a/lib/librefuse/refuse.c    Mon Jan 07 15:41:55 2013 +0000
+++ b/lib/librefuse/refuse.c    Mon Jan 07 15:54:00 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refuse.c,v 1.95 2011/11/24 01:56:22 manu Exp $ */
+/*     $NetBSD: refuse.c,v 1.95.2.1 2013/01/07 15:54:00 riz Exp $      */
 
 /*
  * Copyright © 2007 Alistair Crooks.  All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: refuse.c,v 1.95 2011/11/24 01:56:22 manu Exp $");
+__RCSID("$NetBSD: refuse.c,v 1.95.2.1 2013/01/07 15:54:00 riz Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -1083,14 +1083,16 @@
        ret = (*fuse->op.write)(path, (char *)buf, *resid, offset,
            &rn->file_info);
 
-       if (ret > 0) {
+       if (ret >= 0) {
                if ((uint64_t)(offset + ret) > pn->pn_va.va_size)
                        pn->pn_va.va_size = offset + ret;
                *resid -= ret;
-               ret = 0;
+               ret = (*resid == 0) ? 0 : ENOSPC;
+       } else {
+               ret = -ret;
        }
 
-       return -ret;
+       return ret;
 }
 
 



Home | Main Index | Thread Index | Old Index