Source-Changes-HG archive

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

[src/trunk]: src/lib/librefuse Call the FUSE init operation before we try to ...



details:   https://anonhg.NetBSD.org/src/rev/3d303da6944a
branches:  trunk
changeset: 767139:3d303da6944a
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 09 17:16:46 2011 +0000

description:
Call the FUSE init operation before we try to access the file-system.
This prevents a crash in "fuse_ext2" which I previously worked around
with a patch.

diffstat:

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

diffs (38 lines):

diff -r 294c52ba9e15 -r 3d303da6944a lib/librefuse/refuse.c
--- a/lib/librefuse/refuse.c    Sat Jul 09 17:15:46 2011 +0000
+++ b/lib/librefuse/refuse.c    Sat Jul 09 17:16:46 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refuse.c,v 1.93 2011/07/09 14:50:00 tron Exp $ */
+/*     $NetBSD: refuse.c,v 1.94 2011/07/09 17:16:46 tron 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.93 2011/07/09 14:50:00 tron Exp $");
+__RCSID("$NetBSD: refuse.c,v 1.94 2011/07/09 17:16:46 tron Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -1298,6 +1298,9 @@
 
        fuse->fc = fc;
 
+       if (fuse->op.init != NULL)
+               fusectx->private_data = fuse->op.init(NULL); /* XXX */
+
        /* initialise the puffs operations structure */
         PUFFSOP_INIT(pops);
 
@@ -1361,9 +1364,6 @@
                        puffs_stat2vattr(&pn_root->pn_va, &st);
        assert(pn_root->pn_va.va_type == VDIR);
 
-       if (fuse->op.init)
-               fusectx->private_data = fuse->op.init(NULL); /* XXX */
-
        puffs_set_prepost(pu, set_fuse_context_pid, NULL);
 
        puffs_zerostatvfs(&svfsb);



Home | Main Index | Thread Index | Old Index