Skip to contentSkip to conversation

virtiofs queue

GIT PULL Applied Dr. David Alan Gilbert (git) 3 participants 113 messages Jan 23, 2020 – Mar 20, 2020 Page 2 of 2

Subsystems (2)
lore
Share & tools
lore
#57 lore raw

[PULL 059/108] virtiofsd: print log only when priority is high enough

In reply to Dr. David Alan Gilbert (git)

From: Eryu Guan <[email protected]>

Introduce "-o log_level=" command line option to specify current log level (priority), valid values are "debug info warn err", e.g.

./virtiofsd -o log_level=debug ...

So only log priority higher than "debug" will be printed to stderr/syslog. And the default level is info.

The "-o debug"/"-d" options are kept, and imply debug log level.

dgilbert: Reworked for libfuse's log_func

with fix by:

---
 tools/virtiofsd/fuse_lowlevel.c  |  75 ++++++++------------
 tools/virtiofsd/fuse_lowlevel.h  |   1 +
 tools/virtiofsd/helper.c         |   8 ++-
 tools/virtiofsd/passthrough_ll.c | 118 +++++++++++++------------------
 4 files changed, 87 insertions(+), 115 deletions(-)
tools/virtiofsd/fuse_lowlevel.c +30 -45
index 6ceb33d913..a7a19685b5 100644
@@ -158,19 +158,17 @@ static int fuse_send_msg(struct fuse_session *se, struct fuse_chan *ch,
     struct fuse_out_header *out = iov[0].iov_base;
 
     out->len = iov_length(iov, count);
-    if (se->debug) {
-        if (out->unique == 0) {
-            fuse_log(FUSE_LOG_DEBUG, "NOTIFY: code=%d length=%u\n", out->error,
-                     out->len);
-        } else if (out->error) {
-            fuse_log(FUSE_LOG_DEBUG,
-                     "   unique: %llu, error: %i (%s), outsize: %i\n",
-                     (unsigned long long)out->unique, out->error,
-                     strerror(-out->error), out->len);
-        } else {
-            fuse_log(FUSE_LOG_DEBUG, "   unique: %llu, success, outsize: %i\n",
-                     (unsigned long long)out->unique, out->len);
-        }
+    if (out->unique == 0) {
+        fuse_log(FUSE_LOG_DEBUG, "NOTIFY: code=%d length=%u\n", out->error,
+                 out->len);
+    } else if (out->error) {
+        fuse_log(FUSE_LOG_DEBUG,
+                 "   unique: %llu, error: %i (%s), outsize: %i\n",
+                 (unsigned long long)out->unique, out->error,
+                 strerror(-out->error), out->len);
+    } else {
+        fuse_log(FUSE_LOG_DEBUG, "   unique: %llu, success, outsize: %i\n",
+                 (unsigned long long)out->unique, out->len);
     }
 
     if (fuse_lowlevel_is_virtio(se)) {
@@ -1662,10 +1660,8 @@ static void do_interrupt(fuse_req_t req, fuse_ino_t nodeid,
         return;
     }
 
-    if (se->debug) {
-        fuse_log(FUSE_LOG_DEBUG, "INTERRUPT: %llu\n",
-                 (unsigned long long)arg->unique);
-    }
+    fuse_log(FUSE_LOG_DEBUG, "INTERRUPT: %llu\n",
+             (unsigned long long)arg->unique);
 
     req->u.i.unique = arg->unique;
 
@@ -1901,13 +1897,10 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid,
         }
     }
 
-    if (se->debug) {
-        fuse_log(FUSE_LOG_DEBUG, "INIT: %u.%u\n", arg->major, arg->minor);
-        if (arg->major == 7 && arg->minor >= 6) {
-            fuse_log(FUSE_LOG_DEBUG, "flags=0x%08x\n", arg->flags);
-            fuse_log(FUSE_LOG_DEBUG, "max_readahead=0x%08x\n",
-                     arg->max_readahead);
-        }
+    fuse_log(FUSE_LOG_DEBUG, "INIT: %u.%u\n", arg->major, arg->minor);
+    if (arg->major == 7 && arg->minor >= 6) {
+        fuse_log(FUSE_LOG_DEBUG, "flags=0x%08x\n", arg->flags);
+        fuse_log(FUSE_LOG_DEBUG, "max_readahead=0x%08x\n", arg->max_readahead);
     }
     se->conn.proto_major = arg->major;
     se->conn.proto_minor = arg->minor;
@@ -2116,19 +2109,14 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid,
     outarg.congestion_threshold = se->conn.congestion_threshold;
     outarg.time_gran = se->conn.time_gran;
 
-    if (se->debug) {
-        fuse_log(FUSE_LOG_DEBUG, "   INIT: %u.%u\n", outarg.major,
-                 outarg.minor);
-        fuse_log(FUSE_LOG_DEBUG, "   flags=0x%08x\n", outarg.flags);
-        fuse_log(FUSE_LOG_DEBUG, "   max_readahead=0x%08x\n",
-                 outarg.max_readahead);
-        fuse_log(FUSE_LOG_DEBUG, "   max_write=0x%08x\n", outarg.max_write);
-        fuse_log(FUSE_LOG_DEBUG, "   max_background=%i\n",
-                 outarg.max_background);
-        fuse_log(FUSE_LOG_DEBUG, "   congestion_threshold=%i\n",
-                 outarg.congestion_threshold);
-        fuse_log(FUSE_LOG_DEBUG, "   time_gran=%u\n", outarg.time_gran);
-    }
+    fuse_log(FUSE_LOG_DEBUG, "   INIT: %u.%u\n", outarg.major, outarg.minor);
+    fuse_log(FUSE_LOG_DEBUG, "   flags=0x%08x\n", outarg.flags);
+    fuse_log(FUSE_LOG_DEBUG, "   max_readahead=0x%08x\n", outarg.max_readahead);
+    fuse_log(FUSE_LOG_DEBUG, "   max_write=0x%08x\n", outarg.max_write);
+    fuse_log(FUSE_LOG_DEBUG, "   max_background=%i\n", outarg.max_background);
+    fuse_log(FUSE_LOG_DEBUG, "   congestion_threshold=%i\n",
+             outarg.congestion_threshold);
+    fuse_log(FUSE_LOG_DEBUG, "   time_gran=%u\n", outarg.time_gran);
 
     send_reply_ok(req, &outarg, outargsize);
 }
@@ -2407,14 +2395,11 @@ void fuse_session_process_buf_int(struct fuse_session *se,
     in = fuse_mbuf_iter_advance(&iter, sizeof(*in));
     assert(in); /* caller guarantees the input buffer is large enough */
 
-    if (se->debug) {
-        fuse_log(FUSE_LOG_DEBUG,
-                 "unique: %llu, opcode: %s (%i), nodeid: %llu, insize: %zu, "
-                 "pid: %u\n",
-                 (unsigned long long)in->unique,
-                 opname((enum fuse_opcode)in->opcode), in->opcode,
-                 (unsigned long long)in->nodeid, buf->size, in->pid);
-    }
+    fuse_log(
+        FUSE_LOG_DEBUG,
+        "unique: %llu, opcode: %s (%i), nodeid: %llu, insize: %zu, pid: %u\n",
+        (unsigned long long)in->unique, opname((enum fuse_opcode)in->opcode),
+        in->opcode, (unsigned long long)in->nodeid, buf->size, in->pid);
 
     req = fuse_ll_alloc_req(se);
     if (req == NULL) {
tools/virtiofsd/fuse_lowlevel.h +1 -0
index f2750bc189..138041e5f1 100644
@@ -1796,6 +1796,7 @@ struct fuse_cmdline_opts {
     int show_help;
     int print_capabilities;
     int syslog;
+    int log_level;
     unsigned int max_idle_threads;
 };
 
tools/virtiofsd/helper.c +7 -1
index 9692ef9f1f..6d50a46a7e 100644
@@ -34,7 +34,6 @@
         t, offsetof(struct fuse_cmdline_opts, p), v \
     }
 
-
 static const struct fuse_opt fuse_helper_opts[] = {
     FUSE_HELPER_OPT("-h", show_help),
     FUSE_HELPER_OPT("--help", show_help),
@@ -55,6 +54,10 @@ static const struct fuse_opt fuse_helper_opts[] = {
     FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP),
     FUSE_HELPER_OPT("max_idle_threads=%u", max_idle_threads),
     FUSE_HELPER_OPT("--syslog", syslog),
+    FUSE_HELPER_OPT_VALUE("log_level=debug", log_level, FUSE_LOG_DEBUG),
+    FUSE_HELPER_OPT_VALUE("log_level=info", log_level, FUSE_LOG_INFO),
+    FUSE_HELPER_OPT_VALUE("log_level=warn", log_level, FUSE_LOG_WARNING),
+    FUSE_HELPER_OPT_VALUE("log_level=err", log_level, FUSE_LOG_ERR),
     FUSE_OPT_END
 };
 
@@ -142,6 +145,9 @@ void fuse_cmdline_help(void)
            "    --syslog                   log to syslog (default stderr)\n"
            "    -f                         foreground operation\n"
            "    --daemonize                run in background\n"
+           "    -o log_level=<level>       log level, default to \"info\"\n"
+           "                               level could be one of \"debug, "
+           "info, warn, err\"\n"
            "    -o max_idle_threads        the maximum number of idle worker "
            "threads\n"
            "                               allowed (default: 10)\n"
tools/virtiofsd/passthrough_ll.c +49 -69

237 lines not on this page · raw message

Signature · 1 line
2.24.1
#58 lore raw

[PULL 014/108] vitriofsd/passthrough_ll: fix fallocate() ifdefs

In reply to Dr. David Alan Gilbert (git)

From: Xiao Yang <[email protected]>

1) Use correct CONFIG_FALLOCATE macro to check if fallocate() is supported.(i.e configure script sets CONFIG_FALLOCATE intead of HAVE_FALLOCATE if fallocate() is supported)
2) Replace HAVE_POSIX_FALLOCATE with CONFIG_POSIX_FALLOCATE.

Merged from two of Xiao Yang's patches

---
 tools/virtiofsd/passthrough_ll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/virtiofsd/passthrough_ll.c +2 -2
index 322a889cdf..6c4da18075 100644
@@ -975,13 +975,13 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
     int err = EOPNOTSUPP;
     (void)ino;
 
-#ifdef HAVE_FALLOCATE
+#ifdef CONFIG_FALLOCATE
     err = fallocate(fi->fh, mode, offset, length);
     if (err < 0) {
         err = errno;
     }
 
-#elif defined(HAVE_POSIX_FALLOCATE)
+#elif defined(CONFIG_POSIX_FALLOCATE)
     if (mode) {
         fuse_reply_err(req, EOPNOTSUPP);
         return;
Signature · 1 line
2.24.1
#59 lore raw

[PULL 100/108] virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance

In reply to Dr. David Alan Gilbert (git)

From: piaojun <[email protected]>

fuse_buf_writev() only handles the normal write in which src is buffer and dest is fd. Specially if src buffer represents guest physical address that can't be mapped by the daemon process, IO must be bounced back to the VMM to do it by fuse_buf_copy().

---
 tools/virtiofsd/buffer.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
tools/virtiofsd/buffer.c +18 -2
index 37befebac2..27c1377f22 100644
@@ -34,7 +34,6 @@ size_t fuse_buf_size(const struct fuse_bufvec *bufv)
     return size;
 }
 
-__attribute__((unused))
 static ssize_t fuse_buf_writev(struct fuse_buf *out_buf,
                                struct fuse_bufvec *in_buf)
 {
@@ -262,12 +261,29 @@ static int fuse_bufvec_advance(struct fuse_bufvec *bufv, size_t len)
 
 ssize_t fuse_buf_copy(struct fuse_bufvec *dstv, struct fuse_bufvec *srcv)
 {
-    size_t copied = 0;
+    size_t copied = 0, i;
 
     if (dstv == srcv) {
         return fuse_buf_size(dstv);
     }
 
+    /*
+     * use writev to improve bandwidth when all the
+     * src buffers already mapped by the daemon
+     * process
+     */
+    for (i = 0; i < srcv->count; i++) {
+        if (srcv->buf[i].flags & FUSE_BUF_IS_FD) {
+            break;
+        }
+    }
+    if ((i == srcv->count) && (dstv->count == 1) &&
+        (dstv->idx == 0) &&
+        (dstv->buf[0].flags & FUSE_BUF_IS_FD)) {
+        dstv->buf[0].pos += dstv->off;
+        return fuse_buf_writev(&dstv->buf[0], srcv);
+    }
+
     for (;;) {
         const struct fuse_buf *src = fuse_bufvec_current(srcv);
         const struct fuse_buf *dst = fuse_bufvec_current(dstv);
Signature · 1 line
2.24.1
#60 lore raw

[PULL 063/108] virtiofsd: Handle hard reboot

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Handle a
mount
hard reboot (without unmount)
mount

we get another 'init' which FUSE doesn't normally expect.

---
 tools/virtiofsd/fuse_lowlevel.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
tools/virtiofsd/fuse_lowlevel.c +15 -1
index 7d742b5a72..65f91dabae 100644
@@ -2433,7 +2433,21 @@ void fuse_session_process_buf_int(struct fuse_session *se,
             goto reply_err;
         }
     } else if (in->opcode == FUSE_INIT || in->opcode == CUSE_INIT) {
-        goto reply_err;
+        if (fuse_lowlevel_is_virtio(se)) {
+            /*
+             * TODO: This is after a hard reboot typically, we need to do
+             * a destroy, but we can't reply to this request yet so
+             * we can't use do_destroy
+             */
+            fuse_log(FUSE_LOG_DEBUG, "%s: reinit\n", __func__);
+            se->got_destroy = 1;
+            se->got_init = 0;
+            if (se->op.destroy) {
+                se->op.destroy(se->userdata);
+            }
+        } else {
+            goto reply_err;
+        }
     }
 
     err = EACCES;
Signature · 1 line
2.24.1
#61 lore raw

[PULL 016/108] virtiofsd: Add options for virtio

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Add options to specify parameters for virtio-fs paths, i.e.

./virtiofsd -o vhost_user_socket=/tmp/vhostqemu

---
 tools/virtiofsd/fuse_i.h        |  1 +
 tools/virtiofsd/fuse_lowlevel.c | 11 ++++++++---
 tools/virtiofsd/helper.c        | 14 +++++++-------
 3 files changed, 16 insertions(+), 10 deletions(-)
tools/virtiofsd/fuse_i.h +1 -0
index bae06992e0..26b1a7da88 100644
@@ -63,6 +63,7 @@ struct fuse_session {
     struct fuse_notify_req notify_list;
     size_t bufsize;
     int error;
+    char *vu_socket_path;
 };
 
 struct fuse_chan {
tools/virtiofsd/fuse_lowlevel.c +8 -3
index 8552cfb8af..17e8718283 100644
@@ -2115,8 +2115,11 @@ reply_err:
     }
 
 static const struct fuse_opt fuse_ll_opts[] = {
-    LL_OPTION("debug", debug, 1), LL_OPTION("-d", debug, 1),
-    LL_OPTION("--debug", debug, 1), LL_OPTION("allow_root", deny_others, 1),
+    LL_OPTION("debug", debug, 1),
+    LL_OPTION("-d", debug, 1),
+    LL_OPTION("--debug", debug, 1),
+    LL_OPTION("allow_root", deny_others, 1),
+    LL_OPTION("--socket-path=%s", vu_socket_path, 0),
     FUSE_OPT_END
 };
 
@@ -2132,7 +2135,9 @@ void fuse_lowlevel_help(void)
      * These are not all options, but the ones that are
      * potentially of interest to an end-user
      */
-    printf("    -o allow_root          allow access by root\n");
+    printf(
+        "    -o allow_root              allow access by root\n"
+        "    --socket-path=PATH         path for the vhost-user socket\n");
 }
 
 void fuse_session_destroy(struct fuse_session *se)
tools/virtiofsd/helper.c +7 -7
index 9333691525..676032e71f 100644
@@ -127,13 +127,13 @@ static const struct fuse_opt conn_info_opt_spec[] = {
 
 void fuse_cmdline_help(void)
 {
-    printf(
-        "    -h   --help            print help\n"
-        "    -V   --version         print version\n"
-        "    -d   -o debug          enable debug output (implies -f)\n"
-        "    -f                     foreground operation\n"
-        "    -o max_idle_threads    the maximum number of idle worker threads\n"
-        "                           allowed (default: 10)\n");
+    printf("    -h   --help                print help\n"
+           "    -V   --version             print version\n"
+           "    -d   -o debug              enable debug output (implies -f)\n"
+           "    -f                         foreground operation\n"
+           "    -o max_idle_threads        the maximum number of idle worker "
+           "threads\n"
+           "                               allowed (default: 10)\n");
 }
 
 static int fuse_helper_opt_proc(void *data, const char *arg, int key,
Signature · 1 line
2.24.1
#62 lore raw

[PULL 103/108] virtiofsd: fix lo_destroy() resource leaks

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Now that lo_destroy() is serialized we can call unref_inode() so that all inode resources are freed.

---
 tools/virtiofsd/passthrough_ll.c | 41 ++++++++++++++++----------------
 1 file changed, 20 insertions(+), 21 deletions(-)
tools/virtiofsd/passthrough_ll.c +20 -21
index 79b8b71a4f..eb001b9d1e 100644
@@ -1371,26 +1371,6 @@ static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
     }
 }
 
-static int unref_all_inodes_cb(gpointer key, gpointer value, gpointer user_data)
-{
-    struct lo_inode *inode = value;
-    struct lo_data *lo = user_data;
-
-    inode->nlookup = 0;
-    lo_map_remove(&lo->ino_map, inode->fuse_ino);
-    close(inode->fd);
-    lo_inode_put(lo, &inode); /* Drop our refcount from lo_do_lookup() */
-
-    return TRUE;
-}
-
-static void unref_all_inodes(struct lo_data *lo)
-{
-    pthread_mutex_lock(&lo->mutex);
-    g_hash_table_foreach_remove(lo->inodes, unref_all_inodes_cb, lo);
-    pthread_mutex_unlock(&lo->mutex);
-}
-
 static void lo_forget_one(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
 {
     struct lo_data *lo = lo_data(req);
@@ -2477,7 +2457,26 @@ static void lo_lseek(fuse_req_t req, fuse_ino_t ino, off_t off, int whence,
 static void lo_destroy(void *userdata)
 {
     struct lo_data *lo = (struct lo_data *)userdata;
-    unref_all_inodes(lo);
+
+    /*
+     * Normally lo->mutex must be taken when traversing lo->inodes but
+     * lo_destroy() is a serialized request so no races are possible here.
+     *
+     * In addition, we cannot acquire lo->mutex since unref_inode() takes it
+     * too and this would result in a recursive lock.
+     */
+    while (true) {
+        GHashTableIter iter;
+        gpointer key, value;
+
+        g_hash_table_iter_init(&iter, lo->inodes);
+        if (!g_hash_table_iter_next(&iter, &key, &value)) {
+            break;
+        }
+
+        struct lo_inode *inode = value;
+        unref_inode_lolocked(lo, inode, inode->nlookup);
+    }
 }
 
 static struct fuse_lowlevel_ops lo_oper = {
Signature · 1 line
2.24.1
#63 lore raw

[PULL 068/108] virtiofsd: passthrough_ll: disable readdirplus on cache=never

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

...because the attributes sent in the READDIRPLUS reply would be discarded anyway.

---
 tools/virtiofsd/passthrough_ll.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/virtiofsd/passthrough_ll.c +4 -0
index 18d69abcbc..6480c517dc 100644
@@ -478,6 +478,10 @@ static void lo_init(void *userdata, struct fuse_conn_info *conn)
         fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
         conn->want |= FUSE_CAP_FLOCK_LOCKS;
     }
+    if (lo->cache == CACHE_NEVER) {
+        fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling readdirplus\n");
+        conn->want &= ~FUSE_CAP_READDIRPLUS;
+    }
 }
 
 static void lo_getattr(fuse_req_t req, fuse_ino_t ino,
Signature · 1 line
2.24.1
#64 lore raw

[PULL 015/108] virtiofsd: Make fsync work even if only inode is passed in

In reply to Dr. David Alan Gilbert (git)

From: Vivek Goyal <[email protected]>

If caller has not sent file handle in request, then using inode, retrieve the fd opened using O_PATH and use that to open file again and issue fsync. This will be needed when dax_flush() calls fsync. At that time we only have inode information (and not file).

---
 tools/virtiofsd/fuse_lowlevel.c  |  6 +++++-
 tools/virtiofsd/passthrough_ll.c | 28 ++++++++++++++++++++++++++--
 2 files changed, 31 insertions(+), 3 deletions(-)
tools/virtiofsd/fuse_lowlevel.c +5 -1
index 514d79cb24..8552cfb8af 100644
@@ -1075,7 +1075,11 @@ static void do_fsync(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
     fi.fh = arg->fh;
 
     if (req->se->op.fsync) {
-        req->se->op.fsync(req, nodeid, datasync, &fi);
+        if (fi.fh == (uint64_t)-1) {
+            req->se->op.fsync(req, nodeid, datasync, NULL);
+        } else {
+            req->se->op.fsync(req, nodeid, datasync, &fi);
+        }
     } else {
         fuse_reply_err(req, ENOSYS);
     }
tools/virtiofsd/passthrough_ll.c +26 -2
index 6c4da18075..26ac87013b 100644
@@ -903,10 +903,34 @@ static void lo_fsync(fuse_req_t req, fuse_ino_t ino, int datasync,
 {
     int res;
     (void)ino;
+    int fd;
+    char *buf;
+
+    fuse_log(FUSE_LOG_DEBUG, "lo_fsync(ino=%" PRIu64 ", fi=0x%p)\n", ino,
+             (void *)fi);
+
+    if (!fi) {
+        res = asprintf(&buf, "/proc/self/fd/%i", lo_fd(req, ino));
+        if (res == -1) {
+            return (void)fuse_reply_err(req, errno);
+        }
+
+        fd = open(buf, O_RDWR);
+        free(buf);
+        if (fd == -1) {
+            return (void)fuse_reply_err(req, errno);
+        }
+    } else {
+        fd = fi->fh;
+    }
+
     if (datasync) {
-        res = fdatasync(fi->fh);
+        res = fdatasync(fd);
     } else {
-        res = fsync(fi->fh);
+        res = fsync(fd);
+    }
+    if (!fi) {
+        close(fd);
     }
     fuse_reply_err(req, res == -1 ? errno : 0);
 }
Signature · 1 line
2.24.1
#65 lore raw

[PULL 071/108] virtiofsd: fail when parent inode isn't known in lo_do_lookup()

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

The Linux file handle APIs (struct export_operations) can access inodes that are not attached to parents because path name traversal is not performed. Refuse if there is no parent in lo_do_lookup().

Also clean up lo_do_lookup() while we're here.

---
 tools/virtiofsd/passthrough_ll.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
tools/virtiofsd/passthrough_ll.c +12 -2
index de12e75a9e..33bfb4d1f4 100644
@@ -777,6 +777,15 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
     struct lo_data *lo = lo_data(req);
     struct lo_inode *inode, *dir = lo_inode(req, parent);
 
+    /*
+     * name_to_handle_at() and open_by_handle_at() can reach here with fuse
+     * mount point in guest, but we don't have its inode info in the
+     * ino_map.
+     */
+    if (!dir) {
+        return ENOENT;
+    }
+
     memset(e, 0, sizeof(*e));
     e->attr_timeout = lo->timeout;
     e->entry_timeout = lo->timeout;
@@ -786,7 +795,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         name = ".";
     }
 
-    newfd = openat(lo_fd(req, parent), name, O_PATH | O_NOFOLLOW);
+    newfd = openat(dir->fd, name, O_PATH | O_NOFOLLOW);
     if (newfd == -1) {
         goto out_err;
     }
@@ -796,7 +805,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         goto out_err;
     }
 
-    inode = lo_find(lo_data(req), &e->attr);
+    inode = lo_find(lo, &e->attr);
     if (inode) {
         close(newfd);
         newfd = -1;
@@ -812,6 +821,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         inode->is_symlink = S_ISLNK(e->attr.st_mode);
         inode->refcount = 1;
         inode->fd = newfd;
+        newfd = -1;
         inode->ino = e->attr.st_ino;
         inode->dev = e->attr.st_dev;
 
Signature · 1 line
2.24.1
#66 lore raw

[PULL 072/108] virtiofsd: extract root inode init into setup_root()

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

Inititialize the root inode in a single place.

dgilbert:
with fix suggested by Misono Tomohiro <[email protected]>

---
 tools/virtiofsd/passthrough_ll.c | 35 +++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 10 deletions(-)
tools/virtiofsd/passthrough_ll.c +25 -10
index 33bfb4d1f4..9e7191eb75 100644
@@ -2351,6 +2351,30 @@ static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
     }
 }
 
+static void setup_root(struct lo_data *lo, struct lo_inode *root)
+{
+    int fd, res;
+    struct stat stat;
+
+    fd = open("/", O_PATH);
+    if (fd == -1) {
+        fuse_log(FUSE_LOG_ERR, "open(%s, O_PATH): %m\n", lo->source);
+        exit(1);
+    }
+
+    res = fstatat(fd, "", &stat, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW);
+    if (res == -1) {
+        fuse_log(FUSE_LOG_ERR, "fstatat(%s): %m\n", lo->source);
+        exit(1);
+    }
+
+    root->is_symlink = false;
+    root->fd = fd;
+    root->ino = stat.st_ino;
+    root->dev = stat.st_dev;
+    root->refcount = 2;
+}
+
 int main(int argc, char *argv[])
 {
     struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
@@ -2426,8 +2450,6 @@ int main(int argc, char *argv[])
     if (lo.debug) {
         current_log_level = FUSE_LOG_DEBUG;
     }
-    lo.root.refcount = 2;
-
     if (lo.source) {
         struct stat stat;
         int res;
@@ -2446,7 +2468,6 @@ int main(int argc, char *argv[])
     } else {
         lo.source = "/";
     }
-    lo.root.is_symlink = false;
     if (!lo.timeout_set) {
         switch (lo.cache) {
         case CACHE_NEVER:
@@ -2466,13 +2487,6 @@ int main(int argc, char *argv[])
         exit(1);
     }
 
-    lo.root.fd = open(lo.source, O_PATH);
-
-    if (lo.root.fd == -1) {
-        fuse_log(FUSE_LOG_ERR, "open(\"%s\", O_PATH): %m\n", lo.source);
-        exit(1);
-    }
-
     se = fuse_session_new(&args, &lo_oper, sizeof(lo_oper), &lo);
     if (se == NULL) {
         goto err_out1;
@@ -2495,6 +2509,7 @@ int main(int argc, char *argv[])
 
     setup_sandbox(&lo, se, opts.syslog);
 
+    setup_root(&lo, &lo.root);
     /* Block until ctrl+c or fusermount -u */
     ret = virtio_loop(se);
 
Signature · 1 line
2.24.1
#67 lore raw

[PULL 020/108] virtiofsd: Add main virtio loop

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Processes incoming requests on the vhost-user fd.

---
 tools/virtiofsd/fuse_virtio.c | 42 ++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)
tools/virtiofsd/fuse_virtio.c +39 -3
index 2ae3c764dd..1928a2025c 100644
@@ -11,12 +11,14 @@
  * See the file COPYING.LIB
  */
 
+#include "fuse_virtio.h"
 #include "fuse_i.h"
 #include "standard-headers/linux/fuse.h"
 #include "fuse_misc.h"
 #include "fuse_opt.h"
-#include "fuse_virtio.h"
 
+#include <assert.h>
+#include <errno.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -80,15 +82,49 @@ static const VuDevIface fv_iface = {
     .queue_is_processed_in_order = fv_queue_order,
 };
 
+/*
+ * Main loop; this mostly deals with events on the vhost-user
+ * socket itself, and not actual fuse data.
+ */
 int virtio_loop(struct fuse_session *se)
 {
     fuse_log(FUSE_LOG_INFO, "%s: Entry\n", __func__);
 
-    while (1) {
-        /* TODO: Add stuffing */
+    while (!fuse_session_exited(se)) {
+        struct pollfd pf[1];
+        pf[0].fd = se->vu_socketfd;
+        pf[0].events = POLLIN;
+        pf[0].revents = 0;
+
+        fuse_log(FUSE_LOG_DEBUG, "%s: Waiting for VU event\n", __func__);
+        int poll_res = ppoll(pf, 1, NULL, NULL);
+
+        if (poll_res == -1) {
+            if (errno == EINTR) {
+                fuse_log(FUSE_LOG_INFO, "%s: ppoll interrupted, going around\n",
+                         __func__);
+                continue;
+            }
+            fuse_log(FUSE_LOG_ERR, "virtio_loop ppoll: %m\n");
+            break;
+        }
+        assert(poll_res == 1);
+        if (pf[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
+            fuse_log(FUSE_LOG_ERR, "%s: Unexpected poll revents %x\n", __func__,
+                     pf[0].revents);
+            break;
+        }
+        assert(pf[0].revents & POLLIN);
+        fuse_log(FUSE_LOG_DEBUG, "%s: Got VU event\n", __func__);
+        if (!vu_dispatch(&se->virtio_dev->dev)) {
+            fuse_log(FUSE_LOG_ERR, "%s: vu_dispatch failed\n", __func__);
+            break;
+        }
     }
 
     fuse_log(FUSE_LOG_INFO, "%s: Exit\n", __func__);
+
+    return 0;
 }
 
 int virtio_session_mount(struct fuse_session *se)
Signature · 1 line
2.24.1
#68 lore raw

[PULL 069/108] virtiofsd: passthrough_ll: control readdirplus

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

---
 tools/virtiofsd/helper.c         | 4 ++++
 tools/virtiofsd/passthrough_ll.c | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
tools/virtiofsd/helper.c +4 -0
index 6d50a46a7e..14f5d70c10 100644
@@ -153,6 +153,10 @@ void fuse_cmdline_help(void)
            "                               allowed (default: 10)\n"
            "    -o norace                  disable racy fallback\n"
            "                               default: false\n"
+           "    -o readdirplus|no_readdirplus\n"
+           "                               enable/disable readirplus\n"
+           "                               default: readdirplus except with "
+           "cache=never\n"
           );
 }
 
tools/virtiofsd/passthrough_ll.c +6 -1
index 6480c517dc..8b1784ff7b 100644
@@ -117,6 +117,8 @@ struct lo_data {
     double timeout;
     int cache;
     int timeout_set;
+    int readdirplus_set;
+    int readdirplus_clear;
     struct lo_inode root; /* protected by lo->mutex */
     struct lo_map ino_map; /* protected by lo->mutex */
     struct lo_map dirp_map; /* protected by lo->mutex */
@@ -140,6 +142,8 @@ static const struct fuse_opt lo_opts[] = {
     { "cache=auto", offsetof(struct lo_data, cache), CACHE_NORMAL },
     { "cache=always", offsetof(struct lo_data, cache), CACHE_ALWAYS },
     { "norace", offsetof(struct lo_data, norace), 1 },
+    { "readdirplus", offsetof(struct lo_data, readdirplus_set), 1 },
+    { "no_readdirplus", offsetof(struct lo_data, readdirplus_clear), 1 },
     FUSE_OPT_END
 };
 static bool use_syslog = false;
@@ -478,7 +482,8 @@ static void lo_init(void *userdata, struct fuse_conn_info *conn)
         fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
         conn->want |= FUSE_CAP_FLOCK_LOCKS;
     }
-    if (lo->cache == CACHE_NEVER) {
+    if ((lo->cache == CACHE_NEVER && !lo->readdirplus_set) ||
+        lo->readdirplus_clear) {
         fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling readdirplus\n");
         conn->want &= ~FUSE_CAP_READDIRPLUS;
     }
Signature · 1 line
2.24.1
#69 lore raw

[PULL 025/108] virtiofsd: Send replies to messages

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Route fuse out messages back through the same queue elements that had the command that triggered the request.

---
 tools/virtiofsd/fuse_lowlevel.c |   4 ++
 tools/virtiofsd/fuse_virtio.c   | 107 ++++++++++++++++++++++++++++++--
 tools/virtiofsd/fuse_virtio.h   |   4 ++
 3 files changed, 111 insertions(+), 4 deletions(-)
tools/virtiofsd/fuse_lowlevel.c +4 -0
index af09fa2b94..380d93bd01 100644
@@ -171,6 +171,10 @@ static int fuse_send_msg(struct fuse_session *se, struct fuse_chan *ch,
         }
     }
 
+    if (fuse_lowlevel_is_virtio(se)) {
+        return virtio_send_msg(se, ch, iov, count);
+    }
+
     abort(); /* virtio should have taken it before here */
     return 0;
 }
tools/virtiofsd/fuse_virtio.c +103 -4

128 lines not on this page · raw message

tools/virtiofsd/fuse_virtio.h +4 -0
index 23026d6e4c..135a14875a 100644
@@ -22,4 +22,8 @@ int virtio_session_mount(struct fuse_session *se);
 
 int virtio_loop(struct fuse_session *se);
 
+
+int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
+                    struct iovec *iov, int count);
+
 #endif
Signature · 1 line
2.24.1
#70 lore raw

[PULL 075/108] virtiofsd: Clean up inodes on destroy

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Clear out our inodes and fd's on a 'destroy' - so we get rid of them if we reboot the guest.

---
 tools/virtiofsd/passthrough_ll.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
tools/virtiofsd/passthrough_ll.c +26 -0
index b176a314d6..9ed77a17fd 100644
@@ -1169,6 +1169,25 @@ static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
     }
 }
 
+static int unref_all_inodes_cb(gpointer key, gpointer value, gpointer user_data)
+{
+    struct lo_inode *inode = value;
+    struct lo_data *lo = user_data;
+
+    inode->refcount = 0;
+    lo_map_remove(&lo->ino_map, inode->fuse_ino);
+    close(inode->fd);
+
+    return TRUE;
+}
+
+static void unref_all_inodes(struct lo_data *lo)
+{
+    pthread_mutex_lock(&lo->mutex);
+    g_hash_table_foreach_remove(lo->inodes, unref_all_inodes_cb, lo);
+    pthread_mutex_unlock(&lo->mutex);
+}
+
 static void lo_forget_one(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
 {
     struct lo_data *lo = lo_data(req);
@@ -2035,6 +2054,12 @@ static void lo_lseek(fuse_req_t req, fuse_ino_t ino, off_t off, int whence,
     }
 }
 
+static void lo_destroy(void *userdata)
+{
+    struct lo_data *lo = (struct lo_data *)userdata;
+    unref_all_inodes(lo);
+}
+
 static struct fuse_lowlevel_ops lo_oper = {
     .init = lo_init,
     .lookup = lo_lookup,
@@ -2073,6 +2098,7 @@ static struct fuse_lowlevel_ops lo_oper = {
     .copy_file_range = lo_copy_file_range,
 #endif
     .lseek = lo_lseek,
+    .destroy = lo_destroy,
 };
 
 /* Print vhost-user.json backend program capabilities */
Signature · 1 line
2.24.1
#71 lore raw

[PULL 026/108] virtiofsd: Keep track of replies

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Keep track of whether we sent a reply to a request; this is a bit paranoid but it means:
a) We should always recycle an element even if there was an error in the request
b) Never try and send two replies on one queue element

---
 tools/virtiofsd/fuse_virtio.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
tools/virtiofsd/fuse_virtio.c +20 -3
index 05d0e29f12..f1adeb6345 100644
@@ -44,6 +44,7 @@ struct fv_QueueInfo {
 
     /* The element for the command currently being processed */
     VuVirtqElement *qe;
+    bool reply_sent;
 };
 
 /*
@@ -178,6 +179,7 @@ int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
 {
     VuVirtqElement *elem;
     VuVirtq *q;
+    int ret = 0;
 
     assert(count >= 1);
     assert(iov[0].iov_len >= sizeof(struct fuse_out_header));
@@ -191,6 +193,7 @@ int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
     assert(out->unique);
     /* For virtio we always have ch */
     assert(ch);
+    assert(!ch->qi->reply_sent);
     elem = ch->qi->qe;
     q = &ch->qi->virtio_dev->dev.vq[ch->qi->qidx];
 
@@ -208,19 +211,23 @@ int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
     if (in_len < sizeof(struct fuse_out_header)) {
         fuse_log(FUSE_LOG_ERR, "%s: elem %d too short for out_header\n",
                  __func__, elem->index);
-        return -E2BIG;
+        ret = -E2BIG;
+        goto err;
     }
     if (in_len < tosend_len) {
         fuse_log(FUSE_LOG_ERR, "%s: elem %d too small for data len %zd\n",
                  __func__, elem->index, tosend_len);
-        return -E2BIG;
+        ret = -E2BIG;
+        goto err;
     }
 
     copy_iov(iov, count, in_sg, in_num, tosend_len);
     vu_queue_push(&se->virtio_dev->dev, q, elem, tosend_len);
     vu_queue_notify(&se->virtio_dev->dev, q);
+    ch->qi->reply_sent = true;
 
-    return 0;
+err:
+    return ret;
 }
 
 /* Thread function for individual queues, created when a queue is 'started' */
@@ -296,6 +303,9 @@ static void *fv_queue_thread(void *opaque)
                 break;
             }
 
+            qi->qe = elem;
+            qi->reply_sent = false;
+
             if (!fbuf.mem) {
                 fbuf.mem = malloc(se->bufsize);
                 assert(fbuf.mem);
@@ -331,6 +341,13 @@ static void *fv_queue_thread(void *opaque)
             /* TODO: Add checks for fuse_session_exited */
             fuse_session_process_buf_int(se, &fbuf, &ch);
 
+            if (!qi->reply_sent) {
+                fuse_log(FUSE_LOG_DEBUG, "%s: elem %d no reply sent\n",
+                         __func__, elem->index);
+                /* I think we've still got to recycle the element */
+                vu_queue_push(dev, q, elem, 0);
+                vu_queue_notify(dev, q);
+            }
             qi->qe = NULL;
             free(elem);
             elem = NULL;
Signature · 1 line
2.24.1
#72 lore raw

[PULL 077/108] virtiofsd: fix error handling in main()

In reply to Dr. David Alan Gilbert (git)

From: Liu Bo <[email protected]>

Neither fuse_parse_cmdline() nor fuse_opt_parse() goes to the right place to do cleanup.

---
 tools/virtiofsd/passthrough_ll.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/virtiofsd/passthrough_ll.c +3 -2
index 9ed77a17fd..af050c6d97 100644
@@ -2443,13 +2443,14 @@ int main(int argc, char *argv[])
     lo_map_init(&lo.fd_map);
 
     if (fuse_parse_cmdline(&args, &opts) != 0) {
-        return 1;
+        goto err_out1;
     }
     fuse_set_log_func(log_func);
     use_syslog = opts.syslog;
     if (use_syslog) {
         openlog("virtiofsd", LOG_PID, LOG_DAEMON);
     }
+
     if (opts.show_help) {
         printf("usage: %s [options]\n\n", argv[0]);
         fuse_cmdline_help();
@@ -2468,7 +2469,7 @@ int main(int argc, char *argv[])
     }
 
     if (fuse_opt_parse(&args, &lo, lo_opts, NULL) == -1) {
-        return 1;
+        goto err_out1;
     }
 
     /*
Signature · 1 line
2.24.1
#73 lore raw

[PULL 029/108] virtiofsd: add --fd=FDNUM fd passing option

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Although --socket-path=PATH is useful for manual invocations, management tools typically create the UNIX domain socket themselves and pass it to the vhost-user device backend. This way QEMU can be launched immediately with a valid socket. No waiting for the vhost-user device backend is required when fd passing is used.

---
 tools/virtiofsd/fuse_i.h        |  1 +
 tools/virtiofsd/fuse_lowlevel.c | 16 ++++++++++++----
 tools/virtiofsd/fuse_virtio.c   | 31 +++++++++++++++++++++++++------
 3 files changed, 38 insertions(+), 10 deletions(-)
tools/virtiofsd/fuse_i.h +1 -0
index 1126723d18..45995f3246 100644
@@ -68,6 +68,7 @@ struct fuse_session {
     size_t bufsize;
     int error;
     char *vu_socket_path;
+    int   vu_listen_fd;
     int   vu_socketfd;
     struct fv_VuDev *virtio_dev;
 };
tools/virtiofsd/fuse_lowlevel.c +12 -4
index 4f4684d942..95f4db8fcf 100644
@@ -2130,6 +2130,7 @@ static const struct fuse_opt fuse_ll_opts[] = {
     LL_OPTION("--debug", debug, 1),
     LL_OPTION("allow_root", deny_others, 1),
     LL_OPTION("--socket-path=%s", vu_socket_path, 0),
+    LL_OPTION("--fd=%d", vu_listen_fd, 0),
     FUSE_OPT_END
 };
 
@@ -2147,7 +2148,8 @@ void fuse_lowlevel_help(void)
      */
     printf(
         "    -o allow_root              allow access by root\n"
-        "    --socket-path=PATH         path for the vhost-user socket\n");
+        "    --socket-path=PATH         path for the vhost-user socket\n"
+        "    --fd=FDNUM                 fd number of vhost-user socket\n");
 }
 
 void fuse_session_destroy(struct fuse_session *se)
@@ -2191,6 +2193,7 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
         goto out1;
     }
     se->fd = -1;
+    se->vu_listen_fd = -1;
     se->conn.max_write = UINT_MAX;
     se->conn.max_readahead = UINT_MAX;
 
@@ -2212,8 +2215,13 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
         goto out4;
     }
 
-    if (!se->vu_socket_path) {
-        fprintf(stderr, "fuse: missing -o vhost_user_socket option\n");
+    if (!se->vu_socket_path && se->vu_listen_fd < 0) {
+        fuse_log(FUSE_LOG_ERR, "fuse: missing --socket-path or --fd option\n");
+        goto out4;
+    }
+    if (se->vu_socket_path && se->vu_listen_fd >= 0) {
+        fuse_log(FUSE_LOG_ERR,
+                 "fuse: --socket-path and --fd cannot be given together\n");
         goto out4;
     }
 
@@ -2253,7 +2261,7 @@ void fuse_session_unmount(struct fuse_session *se)
 
 int fuse_lowlevel_is_virtio(struct fuse_session *se)
 {
-    return se->vu_socket_path != NULL;
+    return !!se->virtio_dev;
 }
 
 #ifdef linux
tools/virtiofsd/fuse_virtio.c +25 -6
index 7e2711b504..635f87756a 100644
@@ -638,18 +638,21 @@ int virtio_loop(struct fuse_session *se)
     return 0;
 }
 
-int virtio_session_mount(struct fuse_session *se)
+static int fv_create_listen_socket(struct fuse_session *se)
 {
     struct sockaddr_un un;
     mode_t old_umask;
 
+    /* Nothing to do if fd is already initialized */
+    if (se->vu_listen_fd >= 0) {
+        return 0;
+    }
+
     if (strlen(se->vu_socket_path) >= sizeof(un.sun_path)) {
         fuse_log(FUSE_LOG_ERR, "Socket path too long\n");
         return -1;
     }
 
-    se->fd = -1;
-
     /*
      * Create the Unix socket to communicate with qemu
      * based on QEMU's vhost-user-bridge
@@ -682,15 +685,31 @@ int virtio_session_mount(struct fuse_session *se)
         return -1;
     }
 
+    se->vu_listen_fd = listen_sock;
+    return 0;
+}
+
+int virtio_session_mount(struct fuse_session *se)
+{
+    int ret;
+
+    ret = fv_create_listen_socket(se);
+    if (ret < 0) {
+        return ret;
+    }
+
+    se->fd = -1;
+
     fuse_log(FUSE_LOG_INFO, "%s: Waiting for vhost-user socket connection...\n",
              __func__);
-    int data_sock = accept(listen_sock, NULL, NULL);
+    int data_sock = accept(se->vu_listen_fd, NULL, NULL);
     if (data_sock == -1) {
         fuse_log(FUSE_LOG_ERR, "vhost socket accept: %m\n");
-        close(listen_sock);
+        close(se->vu_listen_fd);
         return -1;
     }
-    close(listen_sock);
+    close(se->vu_listen_fd);
+    se->vu_listen_fd = -1;
     fuse_log(FUSE_LOG_INFO, "%s: Received vhost-user socket connection\n",
              __func__);
 
Signature · 1 line
2.24.1
#74 lore raw

[PULL 078/108] virtiofsd: cleanup allocated resource in se

In reply to Dr. David Alan Gilbert (git)

From: Liu Bo <[email protected]>

This cleans up unfreed resources in se on quiting, including se->virtio_dev, se->vu_socket_path, se->vu_socketfd.

---
 tools/virtiofsd/fuse_lowlevel.c | 7 +++++++
 tools/virtiofsd/fuse_virtio.c   | 7 +++++++
 tools/virtiofsd/fuse_virtio.h   | 2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)
tools/virtiofsd/fuse_lowlevel.c +7 -0
index 65f91dabae..440508a6ec 100644
@@ -2532,6 +2532,13 @@ void fuse_session_destroy(struct fuse_session *se)
     if (se->fd != -1) {
         close(se->fd);
     }
+
+    if (se->vu_socket_path) {
+        virtio_session_close(se);
+        free(se->vu_socket_path);
+        se->vu_socket_path = NULL;
+    }
+
     free(se);
 }
 
tools/virtiofsd/fuse_virtio.c +7 -0
index 7a8774a3ee..e7bd772805 100644
@@ -833,3 +833,10 @@ int virtio_session_mount(struct fuse_session *se)
 
     return 0;
 }
+
+void virtio_session_close(struct fuse_session *se)
+{
+    close(se->vu_socketfd);
+    free(se->virtio_dev);
+    se->virtio_dev = NULL;
+}
tools/virtiofsd/fuse_virtio.h +1 -1
index cc676b9193..111684032c 100644
@@ -19,7 +19,7 @@
 struct fuse_session;
 
 int virtio_session_mount(struct fuse_session *se);
-
+void virtio_session_close(struct fuse_session *se);
 int virtio_loop(struct fuse_session *se);
 
 
Signature · 1 line
2.24.1
#75 lore raw

[PULL 034/108] virtiofsd: passthrough_ll: create new files in caller's context

In reply to Dr. David Alan Gilbert (git)

From: Vivek Goyal <[email protected]>

We need to create files in the caller's context. Otherwise after creating a file, the caller might not be able to do file operations on that file.

Changed effective uid/gid to caller's uid/gid, create file and then switch back to uid/gid 0.

Use syscall(setresuid, ...) otherwise glibc does some magic to change EUID in all threads, which is not what we want.

---
 tools/virtiofsd/passthrough_ll.c | 96 ++++++++++++++++++++++++++++++--
 1 file changed, 91 insertions(+), 5 deletions(-)
tools/virtiofsd/passthrough_ll.c +91 -5
index cd27c09f59..5e061797d4 100644
@@ -50,6 +50,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/file.h>
+#include <sys/syscall.h>
 #include <sys/xattr.h>
 #include <unistd.h>
 
@@ -83,6 +84,11 @@ struct lo_inode {
     uint64_t refcount; /* protected by lo->mutex */
 };
 
+struct lo_cred {
+    uid_t euid;
+    gid_t egid;
+};
+
 enum {
     CACHE_NEVER,
     CACHE_NORMAL,
@@ -383,6 +389,69 @@ static void lo_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
     }
 }
 
+/*
+ * On some archs, setres*id is limited to 2^16 but they
+ * provide setres*id32 variants that allow 2^32.
+ * Others just let setres*id do 2^32 anyway.
+ */
+#ifdef SYS_setresgid32
+#define OURSYS_setresgid SYS_setresgid32
+#else
+#define OURSYS_setresgid SYS_setresgid
+#endif
+
+#ifdef SYS_setresuid32
+#define OURSYS_setresuid SYS_setresuid32
+#else
+#define OURSYS_setresuid SYS_setresuid
+#endif
+
+/*
+ * Change to uid/gid of caller so that file is created with
+ * ownership of caller.
+ * TODO: What about selinux context?
+ */
+static int lo_change_cred(fuse_req_t req, struct lo_cred *old)
+{
+    int res;
+
+    old->euid = geteuid();
+    old->egid = getegid();
+
+    res = syscall(OURSYS_setresgid, -1, fuse_req_ctx(req)->gid, -1);
+    if (res == -1) {
+        return errno;
+    }
+
+    res = syscall(OURSYS_setresuid, -1, fuse_req_ctx(req)->uid, -1);
+    if (res == -1) {
+        int errno_save = errno;
+
+        syscall(OURSYS_setresgid, -1, old->egid, -1);
+        return errno_save;
+    }
+
+    return 0;
+}
+
+/* Regain Privileges */
+static void lo_restore_cred(struct lo_cred *old)
+{
+    int res;
+
+    res = syscall(OURSYS_setresuid, -1, old->euid, -1);
+    if (res == -1) {
+        fuse_log(FUSE_LOG_ERR, "seteuid(%u): %m\n", old->euid);
+        exit(1);
+    }
+
+    res = syscall(OURSYS_setresgid, -1, old->egid, -1);
+    if (res == -1) {
+        fuse_log(FUSE_LOG_ERR, "setegid(%u): %m\n", old->egid);
+        exit(1);
+    }
+}
+
 static void lo_mknod_symlink(fuse_req_t req, fuse_ino_t parent,
                              const char *name, mode_t mode, dev_t rdev,
                              const char *link)
@@ -391,12 +460,21 @@ static void lo_mknod_symlink(fuse_req_t req, fuse_ino_t parent,
     int saverr;
     struct lo_inode *dir = lo_inode(req, parent);
     struct fuse_entry_param e;
+    struct lo_cred old = {};
 
     saverr = ENOMEM;
 
+    saverr = lo_change_cred(req, &old);
+    if (saverr) {
+        goto out;
+    }
+
     res = mknod_wrapper(dir->fd, name, link, mode, rdev);
 
     saverr = errno;
+
+    lo_restore_cred(&old);
+
     if (res == -1) {
         goto out;
     }
@@ -794,26 +872,34 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
     struct lo_data *lo = lo_data(req);
     struct fuse_entry_param e;
     int err;
+    struct lo_cred old = {};
 
     if (lo_debug(req)) {
         fuse_log(FUSE_LOG_DEBUG, "lo_create(parent=%" PRIu64 ", name=%s)\n",
                  parent, name);
     }
 
+    err = lo_change_cred(req, &old);
+    if (err) {
+        goto out;
+    }
+
     fd = openat(lo_fd(req, parent), name, (fi->flags | O_CREAT) & ~O_NOFOLLOW,
                 mode);
-    if (fd == -1) {
-        return (void)fuse_reply_err(req, errno);
-    }
+    err = fd == -1 ? errno : 0;
+    lo_restore_cred(&old);
 
-    fi->fh = fd;
+    if (!err) {
+        fi->fh = fd;
+        err = lo_do_lookup(req, parent, name, &e);
+    }
     if (lo->cache == CACHE_NEVER) {
         fi->direct_io = 1;
     } else if (lo->cache == CACHE_ALWAYS) {
         fi->keep_cache = 1;
     }
 
-    err = lo_do_lookup(req, parent, name, &e);
+out:
     if (err) {
         fuse_reply_err(req, err);
     } else {
Signature · 1 line
2.24.1
#76 lore raw

[PULL 082/108] virtiofsd: enable PARALLEL_DIROPS during INIT

In reply to Dr. David Alan Gilbert (git)

From: Liu Bo <[email protected]>

lookup is a RO operations, PARALLEL_DIROPS can be enabled.

---
 tools/virtiofsd/fuse_lowlevel.c | 3 +++
 1 file changed, 3 insertions(+)
tools/virtiofsd/fuse_lowlevel.c +3 -0
index aac282f278..70568d22a4 100644
@@ -2062,6 +2062,9 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid,
     if (se->conn.want & FUSE_CAP_ASYNC_READ) {
         outarg.flags |= FUSE_ASYNC_READ;
     }
+    if (se->conn.want & FUSE_CAP_PARALLEL_DIROPS) {
+        outarg.flags |= FUSE_PARALLEL_DIROPS;
+    }
     if (se->conn.want & FUSE_CAP_POSIX_LOCKS) {
         outarg.flags |= FUSE_POSIX_LOCKS;
     }
Signature · 1 line
2.24.1
#77 lore raw

[PULL 033/108] virtiofs: Add maintainers entry

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index 2c768ed3d8..075fdab372 100644
@@ -1595,6 +1595,14 @@ T: git https://github.com/cohuck/qemu.git s390-next
 T: git https://github.com/borntraeger/qemu.git s390-next
 L: [email protected]
 
+virtiofs
+M: Dr. David Alan Gilbert <[email protected]>
+M: Stefan Hajnoczi <[email protected]>
+S: Supported
+F: tools/virtiofsd/*
+F: hw/virtio/vhost-user-fs*
+F: include/hw/virtio/vhost-user-fs.h
+
 virtio-input
 M: Gerd Hoffmann <[email protected]>
 S: Maintained
Signature · 1 line
2.24.1
#78 lore raw

[PULL 083/108] virtiofsd: fix incorrect error handling in lo_do_lookup

In reply to Dr. David Alan Gilbert (git)

From: Eric Ren <[email protected]>

---
 tools/virtiofsd/passthrough_ll.c | 1 -
 1 file changed, 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +0 -1
index e8dc5c7320..05b5f898db 100644
@@ -814,7 +814,6 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         close(newfd);
         newfd = -1;
     } else {
-        saverr = ENOMEM;
         inode = calloc(1, sizeof(struct lo_inode));
         if (!inode) {
             goto out_err;
Signature · 1 line
2.24.1
#79 lore raw

[PULL 037/108] virtiofsd: passthrough_ll: add dirp_map to hide lo_dirp pointers

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Do not expose lo_dirp pointers to clients.

---
 tools/virtiofsd/passthrough_ll.c | 103 +++++++++++++++++++++++--------
 1 file changed, 76 insertions(+), 27 deletions(-)
tools/virtiofsd/passthrough_ll.c +76 -27
index a3ebf74eab..5f5a72fdbb 100644
@@ -56,27 +56,10 @@
 
 #include "passthrough_helpers.h"
 
-/*
- * We are re-using pointers to our `struct lo_inode`
- * elements as inodes. This means that we must be able to
- * store uintptr_t values in a fuse_ino_t variable. The following
- * incantation checks this condition at compile time.
- */
-#if defined(__GNUC__) &&                                      \
-    (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && \
-    !defined __cplusplus
-_Static_assert(sizeof(fuse_ino_t) >= sizeof(uintptr_t),
-               "fuse_ino_t too small to hold uintptr_t values!");
-#else
-struct _uintptr_to_must_hold_fuse_ino_t_dummy_struct {
-    unsigned _uintptr_to_must_hold_fuse_ino_t
-        : ((sizeof(fuse_ino_t) >= sizeof(uintptr_t)) ? 1 : -1);
-};
-#endif
-
 struct lo_map_elem {
     union {
         struct lo_inode *inode;
+        struct lo_dirp *dirp;
         ssize_t freelist;
     };
     bool in_use;
@@ -123,6 +106,7 @@ struct lo_data {
     int timeout_set;
     struct lo_inode root; /* protected by lo->mutex */
     struct lo_map ino_map; /* protected by lo->mutex */
+    struct lo_map dirp_map; /* protected by lo->mutex */
 };
 
 static const struct fuse_opt lo_opts[] = {
@@ -252,6 +236,20 @@ static void lo_map_remove(struct lo_map *map, size_t key)
     map->freelist = key;
 }
 
+/* Assumes lo->mutex is held */
+static ssize_t lo_add_dirp_mapping(fuse_req_t req, struct lo_dirp *dirp)
+{
+    struct lo_map_elem *elem;
+
+    elem = lo_map_alloc_elem(&lo_data(req)->dirp_map);
+    if (!elem) {
+        return -1;
+    }
+
+    elem->dirp = dirp;
+    return elem - lo_data(req)->dirp_map.elems;
+}
+
 /* Assumes lo->mutex is held */
 static ssize_t lo_add_inode_mapping(fuse_req_t req, struct lo_inode *inode)
 {
@@ -861,9 +859,19 @@ struct lo_dirp {
     off_t offset;
 };
 
-static struct lo_dirp *lo_dirp(struct fuse_file_info *fi)
+static struct lo_dirp *lo_dirp(fuse_req_t req, struct fuse_file_info *fi)
 {
-    return (struct lo_dirp *)(uintptr_t)fi->fh;
+    struct lo_data *lo = lo_data(req);
+    struct lo_map_elem *elem;
+
+    pthread_mutex_lock(&lo->mutex);
+    elem = lo_map_get(&lo->dirp_map, fi->fh);
+    pthread_mutex_unlock(&lo->mutex);
+    if (!elem) {
+        return NULL;
+    }
+
+    return elem->dirp;
 }
 
 static void lo_opendir(fuse_req_t req, fuse_ino_t ino,
@@ -873,6 +881,7 @@ static void lo_opendir(fuse_req_t req, fuse_ino_t ino,
     struct lo_data *lo = lo_data(req);
     struct lo_dirp *d;
     int fd;
+    ssize_t fh;
 
     d = calloc(1, sizeof(struct lo_dirp));
     if (d == NULL) {
@@ -892,7 +901,14 @@ static void lo_opendir(fuse_req_t req, fuse_ino_t ino,
     d->offset = 0;
     d->entry = NULL;
 
-    fi->fh = (uintptr_t)d;
+    pthread_mutex_lock(&lo->mutex);
+    fh = lo_add_dirp_mapping(req, d);
+    pthread_mutex_unlock(&lo->mutex);
+    if (fh == -1) {
+        goto out_err;
+    }
+
+    fi->fh = fh;
     if (lo->cache == CACHE_ALWAYS) {
         fi->keep_cache = 1;
     }
@@ -903,6 +919,9 @@ out_errno:
     error = errno;
 out_err:
     if (d) {
+        if (d->dp) {
+            closedir(d->dp);
+        }
         if (fd != -1) {
             close(fd);
         }
@@ -920,17 +939,21 @@ static int is_dot_or_dotdot(const char *name)
 static void lo_do_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
                           off_t offset, struct fuse_file_info *fi, int plus)
 {
-    struct lo_dirp *d = lo_dirp(fi);
-    char *buf;
+    struct lo_dirp *d;
+    char *buf = NULL;
     char *p;
     size_t rem = size;
-    int err;
+    int err = ENOMEM;
 
     (void)ino;
 
+    d = lo_dirp(req, fi);
+    if (!d) {
+        goto error;
+    }
+
     buf = calloc(1, size);
     if (!buf) {
-        err = ENOMEM;
         goto error;
     }
     p = buf;
@@ -1028,8 +1051,21 @@ static void lo_readdirplus(fuse_req_t req, fuse_ino_t ino, size_t size,
 static void lo_releasedir(fuse_req_t req, fuse_ino_t ino,
                           struct fuse_file_info *fi)
 {
-    struct lo_dirp *d = lo_dirp(fi);
+    struct lo_data *lo = lo_data(req);
+    struct lo_dirp *d;
+
     (void)ino;
+
+    d = lo_dirp(req, fi);
+    if (!d) {
+        fuse_reply_err(req, EBADF);
+        return;
+    }
+
+    pthread_mutex_lock(&lo->mutex);
+    lo_map_remove(&lo->dirp_map, fi->fh);
+    pthread_mutex_unlock(&lo->mutex);
+
     closedir(d->dp);
     free(d);
     fuse_reply_err(req, 0);
@@ -1081,8 +1117,18 @@ static void lo_fsyncdir(fuse_req_t req, fuse_ino_t ino, int datasync,
                         struct fuse_file_info *fi)
 {
     int res;
-    int fd = dirfd(lo_dirp(fi)->dp);
+    struct lo_dirp *d;
+    int fd;
+
     (void)ino;
+
+    d = lo_dirp(req, fi);
+    if (!d) {
+        fuse_reply_err(req, EBADF);
+        return;
+    }
+
+    fd = dirfd(d->dp);
     if (datasync) {
         res = fdatasync(fd);
     } else {
@@ -1614,6 +1660,8 @@ int main(int argc, char *argv[])
     root_elem = lo_map_reserve(&lo.ino_map, lo.root.fuse_ino);
     root_elem->inode = &lo.root;
 
+    lo_map_init(&lo.dirp_map);
+
     if (fuse_parse_cmdline(&args, &opts) != 0) {
         return 1;
     }
@@ -1710,6 +1758,7 @@ err_out2:
 err_out1:
     fuse_opt_free_args(&args);
 
+    lo_map_destroy(&lo.dirp_map);
     lo_map_destroy(&lo.ino_map);
 
     if (lo.root.fd >= 0) {
Signature · 1 line
2.24.1
#80 lore raw

Re: [PULL 037/108] virtiofsd: passthrough_ll: add dirp_map to hide lo_dirp pointers

Quoted 11 lines · Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Do not expose lo_dirp pointers to clients.

---
 tools/virtiofsd/passthrough_ll.c | 103 +++++++++++++++++++++++--------
 1 file changed, 76 insertions(+), 27 deletions(-)

Hi; Coverity reports (CID 1421933) an issue introduced by this patch:

Quoted 9 lines
tools/virtiofsd/passthrough_ll.c +1 -0
@@ -873,6 +881,7 @@ static void lo_opendir(fuse_req_t req, fuse_ino_t ino,
     struct lo_data *lo = lo_data(req);
     struct lo_dirp *d;
     int fd;
+    ssize_t fh;
 
     d = calloc(1, sizeof(struct lo_dirp));
     if (d == NULL) {

tools/virtiofsd/passthrough_ll.c static void lo_opendir(fuse_req_t req, fuse_ino_t ino, · line 909

Quoted 10 lines
tools/virtiofsd/passthrough_ll.c +6 -1
@@ -892,7 +901,14 @@ static void lo_opendir(fuse_req_t req, fuse_ino_t ino,
     d->offset = 0;
     d->entry = NULL;
 
-    fi->fh = (uintptr_t)d;
+    pthread_mutex_lock(&lo->mutex);
+    fh = lo_add_dirp_mapping(req, d);
+    pthread_mutex_unlock(&lo->mutex);
+    if (fh == -1) {
+        goto out_err;
+    }

This change introduces a new code path which leads to out_err that can be taken after the call to fdopendir(fd) succeeds...

Quoted 6 lines
tools/virtiofsd/passthrough_ll.c +2 -0
+
+    fi->fh = fh;
     if (lo->cache == CACHE_ALWAYS) {
         fi->keep_cache = 1;
     }

tools/virtiofsd/passthrough_ll.c out_errno: · line 927

Quoted 9 lines
tools/virtiofsd/passthrough_ll.c +3 -0
@@ -903,6 +919,9 @@ out_errno:
     error = errno;
 out_err:
     if (d) {
+        if (d->dp) {
+            closedir(d->dp);
+        }
         if (fd != -1) {
             close(fd);
         }

...but here we close(fd), which is an error if fdopendir() succeeded, because that function takes over ownership of the fd it is passed and we should make no more calls on it.

An easy fix would be to add 'fd = -1;' after the call to fdopendir() has succeeded (but that would probably deserve a comment explaining why it's being done); or you might prefer to separate out the error flows so we only call close() for error paths before the fdopendir() succeeds and only call closedir() afterwards. Or you could make the error path

   if (d->dp) {
       closedir(d->dp);
   } else if (fd != -1) {
       close(fd);
   }

thanks
-- PMM

#81 lore raw

[PULL 092/108] virtiofsd: passthrough_ll: fix refcounting on remove/rename

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

---
 tools/virtiofsd/passthrough_ll.c | 50 +++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +49 -1
index c819b5f782..e3a6d6b611 100644
@@ -1140,17 +1140,42 @@ out_err:
     fuse_reply_err(req, saverr);
 }
 
+static struct lo_inode *lookup_name(fuse_req_t req, fuse_ino_t parent,
+                                    const char *name)
+{
+    int res;
+    struct stat attr;
+
+    res = fstatat(lo_fd(req, parent), name, &attr,
+                  AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW);
+    if (res == -1) {
+        return NULL;
+    }
+
+    return lo_find(lo_data(req), &attr);
+}
+
 static void lo_rmdir(fuse_req_t req, fuse_ino_t parent, const char *name)
 {
     int res;
+    struct lo_inode *inode;
+    struct lo_data *lo = lo_data(req);
+
     if (!is_safe_path_component(name)) {
         fuse_reply_err(req, EINVAL);
         return;
     }
 
+    inode = lookup_name(req, parent, name);
+    if (!inode) {
+        fuse_reply_err(req, EIO);
+        return;
+    }
+
     res = unlinkat(lo_fd(req, parent), name, AT_REMOVEDIR);
 
     fuse_reply_err(req, res == -1 ? errno : 0);
+    unref_inode_lolocked(lo, inode, 1);
 }
 
 static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
@@ -1158,12 +1183,23 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
                       unsigned int flags)
 {
     int res;
+    struct lo_inode *oldinode;
+    struct lo_inode *newinode;
+    struct lo_data *lo = lo_data(req);
 
     if (!is_safe_path_component(name) || !is_safe_path_component(newname)) {
         fuse_reply_err(req, EINVAL);
         return;
     }
 
+    oldinode = lookup_name(req, parent, name);
+    newinode = lookup_name(req, newparent, newname);
+
+    if (!oldinode) {
+        fuse_reply_err(req, EIO);
+        goto out;
+    }
+
     if (flags) {
 #ifndef SYS_renameat2
         fuse_reply_err(req, EINVAL);
@@ -1176,26 +1212,38 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
             fuse_reply_err(req, res == -1 ? errno : 0);
         }
 #endif
-        return;
+        goto out;
     }
 
     res = renameat(lo_fd(req, parent), name, lo_fd(req, newparent), newname);
 
     fuse_reply_err(req, res == -1 ? errno : 0);
+out:
+    unref_inode_lolocked(lo, oldinode, 1);
+    unref_inode_lolocked(lo, newinode, 1);
 }
 
 static void lo_unlink(fuse_req_t req, fuse_ino_t parent, const char *name)
 {
     int res;
+    struct lo_inode *inode;
+    struct lo_data *lo = lo_data(req);
 
     if (!is_safe_path_component(name)) {
         fuse_reply_err(req, EINVAL);
         return;
     }
 
+    inode = lookup_name(req, parent, name);
+    if (!inode) {
+        fuse_reply_err(req, EIO);
+        return;
+    }
+
     res = unlinkat(lo_fd(req, parent), name, 0);
 
     fuse_reply_err(req, res == -1 ? errno : 0);
+    unref_inode_lolocked(lo, inode, 1);
 }
 
 static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
Signature · 1 line
2.24.1
#82 lore raw

[PULL 038/108] virtiofsd: passthrough_ll: add fd_map to hide file descriptors

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Do not expose file descriptor numbers to clients. This prevents the abuse of internal file descriptors (like stdin/stdout).

Fix from:

dgilbert:
Added lseek

---
 tools/virtiofsd/passthrough_ll.c | 116 +++++++++++++++++++++++++------
 1 file changed, 94 insertions(+), 22 deletions(-)
tools/virtiofsd/passthrough_ll.c +94 -22
index 5f5a72fdbb..9815bfa5c5 100644
@@ -60,6 +60,7 @@ struct lo_map_elem {
     union {
         struct lo_inode *inode;
         struct lo_dirp *dirp;
+        int fd;
         ssize_t freelist;
     };
     bool in_use;
@@ -107,6 +108,7 @@ struct lo_data {
     struct lo_inode root; /* protected by lo->mutex */
     struct lo_map ino_map; /* protected by lo->mutex */
     struct lo_map dirp_map; /* protected by lo->mutex */
+    struct lo_map fd_map; /* protected by lo->mutex */
 };
 
 static const struct fuse_opt lo_opts[] = {
@@ -236,6 +238,20 @@ static void lo_map_remove(struct lo_map *map, size_t key)
     map->freelist = key;
 }
 
+/* Assumes lo->mutex is held */
+static ssize_t lo_add_fd_mapping(fuse_req_t req, int fd)
+{
+    struct lo_map_elem *elem;
+
+    elem = lo_map_alloc_elem(&lo_data(req)->fd_map);
+    if (!elem) {
+        return -1;
+    }
+
+    elem->fd = fd;
+    return elem - lo_data(req)->fd_map.elems;
+}
+
 /* Assumes lo->mutex is held */
 static ssize_t lo_add_dirp_mapping(fuse_req_t req, struct lo_dirp *dirp)
 {
@@ -350,6 +366,22 @@ static int utimensat_empty_nofollow(struct lo_inode *inode,
     return utimensat(AT_FDCWD, procname, tv, 0);
 }
 
+static int lo_fi_fd(fuse_req_t req, struct fuse_file_info *fi)
+{
+    struct lo_data *lo = lo_data(req);
+    struct lo_map_elem *elem;
+
+    pthread_mutex_lock(&lo->mutex);
+    elem = lo_map_get(&lo->fd_map, fi->fh);
+    pthread_mutex_unlock(&lo->mutex);
+
+    if (!elem) {
+        return -1;
+    }
+
+    return elem->fd;
+}
+
 static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
                        int valid, struct fuse_file_info *fi)
 {
@@ -358,6 +390,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
     struct lo_inode *inode;
     int ifd;
     int res;
+    int fd;
 
     inode = lo_inode(req, ino);
     if (!inode) {
@@ -367,9 +400,14 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
 
     ifd = inode->fd;
 
+    /* If fi->fh is invalid we'll report EBADF later */
+    if (fi) {
+        fd = lo_fi_fd(req, fi);
+    }
+
     if (valid & FUSE_SET_ATTR_MODE) {
         if (fi) {
-            res = fchmod(fi->fh, attr->st_mode);
+            res = fchmod(fd, attr->st_mode);
         } else {
             sprintf(procname, "/proc/self/fd/%i", ifd);
             res = chmod(procname, attr->st_mode);
@@ -389,7 +427,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
     }
     if (valid & FUSE_SET_ATTR_SIZE) {
         if (fi) {
-            res = ftruncate(fi->fh, attr->st_size);
+            res = ftruncate(fd, attr->st_size);
         } else {
             sprintf(procname, "/proc/self/fd/%i", ifd);
             res = truncate(procname, attr->st_size);
@@ -419,7 +457,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
         }
 
         if (fi) {
-            res = futimens(fi->fh, tv);
+            res = futimens(fd, tv);
         } else {
             res = utimensat_empty_nofollow(inode, tv);
         }
@@ -1096,7 +1134,18 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
     lo_restore_cred(&old);
 
     if (!err) {
-        fi->fh = fd;
+        ssize_t fh;
+
+        pthread_mutex_lock(&lo->mutex);
+        fh = lo_add_fd_mapping(req, fd);
+        pthread_mutex_unlock(&lo->mutex);
+        if (fh == -1) {
+            close(fd);
+            fuse_reply_err(req, ENOMEM);
+            return;
+        }
+
+        fi->fh = fh;
         err = lo_do_lookup(req, parent, name, &e);
     }
     if (lo->cache == CACHE_NEVER) {
@@ -1140,6 +1189,7 @@ static void lo_fsyncdir(fuse_req_t req, fuse_ino_t ino, int datasync,
 static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 {
     int fd;
+    ssize_t fh;
     char buf[64];
     struct lo_data *lo = lo_data(req);
 
@@ -1175,7 +1225,16 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
         return (void)fuse_reply_err(req, errno);
     }
 
-    fi->fh = fd;
+    pthread_mutex_lock(&lo->mutex);
+    fh = lo_add_fd_mapping(req, fd);
+    pthread_mutex_unlock(&lo->mutex);
+    if (fh == -1) {
+        close(fd);
+        fuse_reply_err(req, ENOMEM);
+        return;
+    }
+
+    fi->fh = fh;
     if (lo->cache == CACHE_NEVER) {
         fi->direct_io = 1;
     } else if (lo->cache == CACHE_ALWAYS) {
@@ -1187,9 +1246,18 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 static void lo_release(fuse_req_t req, fuse_ino_t ino,
                        struct fuse_file_info *fi)
 {
+    struct lo_data *lo = lo_data(req);
+    int fd;
+
     (void)ino;
 
-    close(fi->fh);
+    fd = lo_fi_fd(req, fi);
+
+    pthread_mutex_lock(&lo->mutex);
+    lo_map_remove(&lo->fd_map, fi->fh);
+    pthread_mutex_unlock(&lo->mutex);
+
+    close(fd);
     fuse_reply_err(req, 0);
 }
 
@@ -1197,7 +1265,7 @@ static void lo_flush(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
 {
     int res;
     (void)ino;
-    res = close(dup(fi->fh));
+    res = close(dup(lo_fi_fd(req, fi)));
     fuse_reply_err(req, res == -1 ? errno : 0);
 }
 
@@ -1224,7 +1292,7 @@ static void lo_fsync(fuse_req_t req, fuse_ino_t ino, int datasync,
             return (void)fuse_reply_err(req, errno);
         }
     } else {
-        fd = fi->fh;
+        fd = lo_fi_fd(req, fi);
     }
 
     if (datasync) {
@@ -1251,7 +1319,7 @@ static void lo_read(fuse_req_t req, fuse_ino_t ino, size_t size, off_t offset,
     }
 
     buf.buf[0].flags = FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK;
-    buf.buf[0].fd = fi->fh;
+    buf.buf[0].fd = lo_fi_fd(req, fi);
     buf.buf[0].pos = offset;
 
     fuse_reply_data(req, &buf);
@@ -1266,7 +1334,7 @@ static void lo_write_buf(fuse_req_t req, fuse_ino_t ino,
     struct fuse_bufvec out_buf = FUSE_BUFVEC_INIT(fuse_buf_size(in_buf));
 
     out_buf.buf[0].flags = FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK;
-    out_buf.buf[0].fd = fi->fh;
+    out_buf.buf[0].fd = lo_fi_fd(req, fi);
     out_buf.buf[0].pos = off;
 
     if (lo_debug(req)) {
@@ -1303,7 +1371,7 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
     (void)ino;
 
 #ifdef CONFIG_FALLOCATE
-    err = fallocate(fi->fh, mode, offset, length);
+    err = fallocate(lo_fi_fd(req, fi), mode, offset, length);
     if (err < 0) {
         err = errno;
     }
@@ -1314,7 +1382,7 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
         return;
     }
 
-    err = posix_fallocate(fi->fh, offset, length);
+    err = posix_fallocate(lo_fi_fd(req, fi), offset, length);
 #endif
 
     fuse_reply_err(req, err);
@@ -1326,7 +1394,7 @@ static void lo_flock(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi,
     int res;
     (void)ino;
 
-    res = flock(fi->fh, op);
+    res = flock(lo_fi_fd(req, fi), op);
 
     fuse_reply_err(req, res == -1 ? errno : 0);
 }
@@ -1551,17 +1619,19 @@ static void lo_copy_file_range(fuse_req_t req, fuse_ino_t ino_in, off_t off_in,
                                off_t off_out, struct fuse_file_info *fi_out,
                                size_t len, int flags)
 {
+    int in_fd, out_fd;
     ssize_t res;
 
-    if (lo_debug(req))
-        fuse_log(FUSE_LOG_DEBUG,
-                 "lo_copy_file_range(ino=%" PRIu64 "/fd=%lu, "
-                 "off=%lu, ino=%" PRIu64 "/fd=%lu, "
-                 "off=%lu, size=%zd, flags=0x%x)\n",
-                 ino_in, fi_in->fh, off_in, ino_out, fi_out->fh, off_out, len,
-                 flags);
+    in_fd = lo_fi_fd(req, fi_in);
+    out_fd = lo_fi_fd(req, fi_out);
+
+    fuse_log(FUSE_LOG_DEBUG,
+             "lo_copy_file_range(ino=%" PRIu64 "/fd=%d, "
+             "off=%lu, ino=%" PRIu64 "/fd=%d, "
+             "off=%lu, size=%zd, flags=0x%x)\n",
+             ino_in, in_fd, off_in, ino_out, out_fd, off_out, len, flags);
 
-    res = copy_file_range(fi_in->fh, &off_in, fi_out->fh, &off_out, len, flags);
+    res = copy_file_range(in_fd, &off_in, out_fd, &off_out, len, flags);
     if (res < 0) {
         fuse_reply_err(req, -errno);
     } else {
@@ -1576,7 +1646,7 @@ static void lo_lseek(fuse_req_t req, fuse_ino_t ino, off_t off, int whence,
     off_t res;
 
     (void)ino;
-    res = lseek(fi->fh, off, whence);
+    res = lseek(lo_fi_fd(req, fi), off, whence);
     if (res != -1) {
         fuse_reply_lseek(req, res);
     } else {
@@ -1661,6 +1731,7 @@ int main(int argc, char *argv[])
     root_elem->inode = &lo.root;
 
     lo_map_init(&lo.dirp_map);
+    lo_map_init(&lo.fd_map);
 
     if (fuse_parse_cmdline(&args, &opts) != 0) {
         return 1;
@@ -1758,6 +1829,7 @@ err_out2:
 err_out1:
     fuse_opt_free_args(&args);
 
+    lo_map_destroy(&lo.fd_map);
     lo_map_destroy(&lo.dirp_map);
     lo_map_destroy(&lo.ino_map);
 
Signature · 1 line
2.24.1
#83 lore raw

[PULL 102/108] virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

When running with multiple threads it can be tricky to handle FUSE_INIT/FUSE_DESTROY in parallel with other request types or in parallel with themselves. Serialize FUSE_INIT and FUSE_DESTROY so that malicious clients cannot trigger race conditions.

---
 tools/virtiofsd/fuse_i.h        |  1 +
 tools/virtiofsd/fuse_lowlevel.c | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
tools/virtiofsd/fuse_i.h +1 -0
index a20854f1c4..1447d86866 100644
@@ -61,6 +61,7 @@ struct fuse_session {
     struct fuse_req list;
     struct fuse_req interrupts;
     pthread_mutex_t lock;
+    pthread_rwlock_t init_rwlock;
     int got_destroy;
     int broken_splice_nonblock;
     uint64_t notify_ctr;
tools/virtiofsd/fuse_lowlevel.c +18 -0
index dab6a31e08..79a4031266 100644
@@ -2428,6 +2428,19 @@ void fuse_session_process_buf_int(struct fuse_session *se,
     req->ctx.pid = in->pid;
     req->ch = ch;
 
+    /*
+     * INIT and DESTROY requests are serialized, all other request types
+     * run in parallel.  This prevents races between FUSE_INIT and ordinary
+     * requests, FUSE_INIT and FUSE_INIT, FUSE_INIT and FUSE_DESTROY, and
+     * FUSE_DESTROY and FUSE_DESTROY.
+     */
+    if (in->opcode == FUSE_INIT || in->opcode == CUSE_INIT ||
+        in->opcode == FUSE_DESTROY) {
+        pthread_rwlock_wrlock(&se->init_rwlock);
+    } else {
+        pthread_rwlock_rdlock(&se->init_rwlock);
+    }
+
     err = EIO;
     if (!se->got_init) {
         enum fuse_opcode expected;
@@ -2485,10 +2498,13 @@ void fuse_session_process_buf_int(struct fuse_session *se,
     } else {
         fuse_ll_ops[in->opcode].func(req, in->nodeid, &iter);
     }
+
+    pthread_rwlock_unlock(&se->init_rwlock);
     return;
 
 reply_err:
     fuse_reply_err(req, err);
+    pthread_rwlock_unlock(&se->init_rwlock);
 }
 
 #define LL_OPTION(n, o, v)                     \
@@ -2531,6 +2547,7 @@ void fuse_session_destroy(struct fuse_session *se)
             se->op.destroy(se->userdata);
         }
     }
+    pthread_rwlock_destroy(&se->init_rwlock);
     pthread_mutex_destroy(&se->lock);
     free(se->cuse_data);
     if (se->fd != -1) {
@@ -2610,6 +2627,7 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
     list_init_req(&se->list);
     list_init_req(&se->interrupts);
     fuse_mutex_init(&se->lock);
+    pthread_rwlock_init(&se->init_rwlock, NULL);
 
     memcpy(&se->op, op, op_size);
     se->owner = getuid();
Signature · 1 line
2.24.1
#84 lore raw

[PULL 040/108] virtiofsd: validate path components

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Several FUSE requests contain single path components. A correct FUSE client sends well-formed path components but there is currently no input validation in case something went wrong or the client is malicious.

Refuse ".", "..", and paths containing '/' when we expect a path component.

---
 tools/virtiofsd/passthrough_ll.c | 59 ++++++++++++++++++++++++++++----
 1 file changed, 53 insertions(+), 6 deletions(-)
tools/virtiofsd/passthrough_ll.c +53 -6
index ac380efcb1..e375406160 100644
@@ -133,6 +133,21 @@ static void unref_inode(struct lo_data *lo, struct lo_inode *inode, uint64_t n);
 
 static struct lo_inode *lo_find(struct lo_data *lo, struct stat *st);
 
+static int is_dot_or_dotdot(const char *name)
+{
+    return name[0] == '.' &&
+           (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'));
+}
+
+/* Is `path` a single path component that is not "." or ".."? */
+static int is_safe_path_component(const char *path)
+{
+    if (strchr(path, '/')) {
+        return 0;
+    }
+
+    return !is_dot_or_dotdot(path);
+}
 
 static struct lo_data *lo_data(fuse_req_t req)
 {
@@ -681,6 +696,15 @@ static void lo_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
                  parent, name);
     }
 
+    /*
+     * Don't use is_safe_path_component(), allow "." and ".." for NFS export
+     * support.
+     */
+    if (strchr(name, '/')) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
     err = lo_do_lookup(req, parent, name, &e);
     if (err) {
         fuse_reply_err(req, err);
@@ -762,6 +786,11 @@ static void lo_mknod_symlink(fuse_req_t req, fuse_ino_t parent,
     struct fuse_entry_param e;
     struct lo_cred old = {};
 
+    if (!is_safe_path_component(name)) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
     dir = lo_inode(req, parent);
     if (!dir) {
         fuse_reply_err(req, EBADF);
@@ -863,6 +892,11 @@ static void lo_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t parent,
     struct fuse_entry_param e;
     int saverr;
 
+    if (!is_safe_path_component(name)) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
     inode = lo_inode(req, ino);
     if (!inode) {
         fuse_reply_err(req, EBADF);
@@ -904,6 +938,10 @@ out_err:
 static void lo_rmdir(fuse_req_t req, fuse_ino_t parent, const char *name)
 {
     int res;
+    if (!is_safe_path_component(name)) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
 
     res = unlinkat(lo_fd(req, parent), name, AT_REMOVEDIR);
 
@@ -916,6 +954,11 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
 {
     int res;
 
+    if (!is_safe_path_component(name) || !is_safe_path_component(newname)) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
     if (flags) {
         fuse_reply_err(req, EINVAL);
         return;
@@ -930,6 +973,11 @@ static void lo_unlink(fuse_req_t req, fuse_ino_t parent, const char *name)
 {
     int res;
 
+    if (!is_safe_path_component(name)) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
     res = unlinkat(lo_fd(req, parent), name, 0);
 
     fuse_reply_err(req, res == -1 ? errno : 0);
@@ -1093,12 +1141,6 @@ out_err:
     fuse_reply_err(req, error);
 }
 
-static int is_dot_or_dotdot(const char *name)
-{
-    return name[0] == '.' &&
-           (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'));
-}
-
 static void lo_do_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
                           off_t offset, struct fuse_file_info *fi, int plus)
 {
@@ -1248,6 +1290,11 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
                  parent, name);
     }
 
+    if (!is_safe_path_component(name)) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
     err = lo_change_cred(req, &old);
     if (err) {
         goto out;
Signature · 1 line
2.24.1
#85 lore raw

[PULL 108/108] virtiofsd: add some options to the help message

In reply to Dr. David Alan Gilbert (git)

From: Masayoshi Mizuma <[email protected]>

Add following options to the help message:
- cache
- flock|no_flock
- norace
- posix_lock|no_posix_lock
- readdirplus|no_readdirplus
- timeout
- writeback|no_writeback
- xattr|no_xattr

dgilbert: Split cache, norace, posix_lock, readdirplus off
into our own earlier patches that added the options

---
 tools/virtiofsd/helper.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tools/virtiofsd/helper.c +9 -1
index f98d8f2eb2..0801cf752c 100644
@@ -148,6 +148,8 @@ void fuse_cmdline_help(void)
            "    -o cache=<mode>            cache mode. could be one of \"auto, "
            "always, none\"\n"
            "                               default: auto\n"
+           "    -o flock|no_flock          enable/disable flock\n"
+           "                               default: no_flock\n"
            "    -o log_level=<level>       log level, default to \"info\"\n"
            "                               level could be one of \"debug, "
            "info, warn, err\"\n"
@@ -163,7 +165,13 @@ void fuse_cmdline_help(void)
            "                               enable/disable readirplus\n"
            "                               default: readdirplus except with "
            "cache=none\n"
-          );
+           "    -o timeout=<number>        I/O timeout (second)\n"
+           "                               default: depends on cache= option.\n"
+           "    -o writeback|no_writeback  enable/disable writeback cache\n"
+           "                               default: no_writeback\n"
+           "    -o xattr|no_xattr          enable/disable xattr\n"
+           "                               default: no_xattr\n"
+           );
 }
 
 static int fuse_helper_opt_proc(void *data, const char *arg, int key,
Signature · 1 line
2.24.1
#86 lore raw

[PULL 042/108] virtiofsd: Pass write iov's all the way through

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Pass the write iov pointing to guest RAM all the way through rather than copying the data.

---
 tools/virtiofsd/fuse_virtio.c | 79 ++++++++++++++++++++++++++++++++---
 1 file changed, 73 insertions(+), 6 deletions(-)
tools/virtiofsd/fuse_virtio.c +73 -6
index fd588a4829..872968f2c8 100644
@@ -454,6 +454,10 @@ static void *fv_queue_thread(void *opaque)
                  __func__, qi->qidx, (size_t)evalue, in_bytes, out_bytes);
 
         while (1) {
+            bool allocated_bufv = false;
+            struct fuse_bufvec bufv;
+            struct fuse_bufvec *pbufv;
+
             /*
              * An element contains one request and the space to send our
              * response They're spread over multiple descriptors in a
@@ -495,14 +499,76 @@ static void *fv_queue_thread(void *opaque)
                          __func__, elem->index);
                 assert(0); /* TODO */
             }
-            copy_from_iov(&fbuf, out_num, out_sg);
-            fbuf.size = out_len;
+            /* Copy just the first element and look at it */
+            copy_from_iov(&fbuf, 1, out_sg);
+
+            if (out_num > 2 &&
+                out_sg[0].iov_len == sizeof(struct fuse_in_header) &&
+                ((struct fuse_in_header *)fbuf.mem)->opcode == FUSE_WRITE &&
+                out_sg[1].iov_len == sizeof(struct fuse_write_in)) {
+                /*
+                 * For a write we don't actually need to copy the
+                 * data, we can just do it straight out of guest memory
+                 * but we must still copy the headers in case the guest
+                 * was nasty and changed them while we were using them.
+                 */
+                fuse_log(FUSE_LOG_DEBUG, "%s: Write special case\n", __func__);
+
+                /* copy the fuse_write_in header after the fuse_in_header */
+                fbuf.mem += out_sg->iov_len;
+                copy_from_iov(&fbuf, 1, out_sg + 1);
+                fbuf.mem -= out_sg->iov_len;
+                fbuf.size = out_sg[0].iov_len + out_sg[1].iov_len;
+
+                /* Allocate the bufv, with space for the rest of the iov */
+                allocated_bufv = true;
+                pbufv = malloc(sizeof(struct fuse_bufvec) +
+                               sizeof(struct fuse_buf) * (out_num - 2));
+                if (!pbufv) {
+                    vu_queue_unpop(dev, q, elem, 0);
+                    free(elem);
+                    fuse_log(FUSE_LOG_ERR, "%s: pbufv malloc failed\n",
+                             __func__);
+                    goto out;
+                }
+
+                pbufv->count = 1;
+                pbufv->buf[0] = fbuf;
+
+                size_t iovindex, pbufvindex;
+                iovindex = 2; /* 2 headers, separate iovs */
+                pbufvindex = 1; /* 2 headers, 1 fusebuf */
+
+                for (; iovindex < out_num; iovindex++, pbufvindex++) {
+                    pbufv->count++;
+                    pbufv->buf[pbufvindex].pos = ~0; /* Dummy */
+                    pbufv->buf[pbufvindex].flags = 0;
+                    pbufv->buf[pbufvindex].mem = out_sg[iovindex].iov_base;
+                    pbufv->buf[pbufvindex].size = out_sg[iovindex].iov_len;
+                }
+            } else {
+                /* Normal (non fast write) path */
+
+                /* Copy the rest of the buffer */
+                fbuf.mem += out_sg->iov_len;
+                copy_from_iov(&fbuf, out_num - 1, out_sg + 1);
+                fbuf.mem -= out_sg->iov_len;
+                fbuf.size = out_len;
 
-            /* TODO! Endianness of header */
+                /* TODO! Endianness of header */
 
-            /* TODO: Add checks for fuse_session_exited */
-            struct fuse_bufvec bufv = { .buf[0] = fbuf, .count = 1 };
-            fuse_session_process_buf_int(se, &bufv, &ch);
+                /* TODO: Add checks for fuse_session_exited */
+                bufv.buf[0] = fbuf;
+                bufv.count = 1;
+                pbufv = &bufv;
+            }
+            pbufv->idx = 0;
+            pbufv->off = 0;
+            fuse_session_process_buf_int(se, pbufv, &ch);
+
+            if (allocated_bufv) {
+                free(pbufv);
+            }
 
             if (!qi->reply_sent) {
                 fuse_log(FUSE_LOG_DEBUG, "%s: elem %d no reply sent\n",
@@ -516,6 +582,7 @@ static void *fv_queue_thread(void *opaque)
             elem = NULL;
         }
     }
+out:
     pthread_mutex_destroy(&ch.lock);
     free(fbuf.mem);
 
Signature · 1 line
2.24.1
#87 lore raw

[PULL 043/108] virtiofsd: add fuse_mbuf_iter API

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Introduce an API for consuming bytes from a buffer with size checks. All FUSE operations will be converted to use this safe API instead of void *inarg.

---
 tools/virtiofsd/buffer.c      | 28 ++++++++++++++++++++
 tools/virtiofsd/fuse_common.h | 49 ++++++++++++++++++++++++++++++++++-
 2 files changed, 76 insertions(+), 1 deletion(-)
tools/virtiofsd/buffer.c +28 -0
index 772efa922d..42a608f6bd 100644
@@ -267,3 +267,31 @@ ssize_t fuse_buf_copy(struct fuse_bufvec *dstv, struct fuse_bufvec *srcv)
 
     return copied;
 }
+
+void *fuse_mbuf_iter_advance(struct fuse_mbuf_iter *iter, size_t len)
+{
+    void *ptr;
+
+    if (len > iter->size - iter->pos) {
+        return NULL;
+    }
+
+    ptr = iter->mem + iter->pos;
+    iter->pos += len;
+    return ptr;
+}
+
+const char *fuse_mbuf_iter_advance_str(struct fuse_mbuf_iter *iter)
+{
+    const char *str = iter->mem + iter->pos;
+    size_t remaining = iter->size - iter->pos;
+    size_t i;
+
+    for (i = 0; i < remaining; i++) {
+        if (str[i] == '\0') {
+            iter->pos += i + 1;
+            return str;
+        }
+    }
+    return NULL;
+}
tools/virtiofsd/fuse_common.h +48 -1

58 lines not on this page · raw message

Signature · 1 line
2.24.1
#88 lore raw

[PULL 044/108] virtiofsd: validate input buffer sizes in do_write_buf()

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

There is a small change in behavior: if fuse_write_in->size doesn't match the input buffer size then the request is failed. Previously write requests with 1 fuse_buf element would truncate to fuse_write_in->size.

---
 tools/virtiofsd/fuse_lowlevel.c | 49 ++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 19 deletions(-)
tools/virtiofsd/fuse_lowlevel.c +30 -19
index 7e10995adc..611e8b0354 100644
@@ -1003,8 +1003,8 @@ static void do_write(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
     }
 }
 
-static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid, const void *inarg,
-                         struct fuse_bufvec *ibufv)
+static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid,
+                         struct fuse_mbuf_iter *iter, struct fuse_bufvec *ibufv)
 {
     struct fuse_session *se = req->se;
     struct fuse_bufvec *pbufv = ibufv;
@@ -1012,28 +1012,27 @@ static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid, const void *inarg,
         .buf[0] = ibufv->buf[0],
         .count = 1,
     };
-    struct fuse_write_in *arg = (struct fuse_write_in *)inarg;
+    struct fuse_write_in *arg;
+    size_t arg_size = sizeof(*arg);
     struct fuse_file_info fi;
 
     memset(&fi, 0, sizeof(fi));
+
+    arg = fuse_mbuf_iter_advance(iter, arg_size);
+    if (!arg) {
+        fuse_reply_err(req, EINVAL);
+        return;
+    }
+
+    fi.lock_owner = arg->lock_owner;
+    fi.flags = arg->flags;
     fi.fh = arg->fh;
     fi.writepage = arg->write_flags & FUSE_WRITE_CACHE;
 
     if (ibufv->count == 1) {
-        fi.lock_owner = arg->lock_owner;
-        fi.flags = arg->flags;
-        if (!(tmpbufv.buf[0].flags & FUSE_BUF_IS_FD)) {
-            tmpbufv.buf[0].mem = PARAM(arg);
-        }
-        tmpbufv.buf[0].size -=
-            sizeof(struct fuse_in_header) + sizeof(struct fuse_write_in);
-        if (tmpbufv.buf[0].size < arg->size) {
-            fuse_log(FUSE_LOG_ERR,
-                     "fuse: do_write_buf: buffer size too small\n");
-            fuse_reply_err(req, EIO);
-            return;
-        }
-        tmpbufv.buf[0].size = arg->size;
+        assert(!(tmpbufv.buf[0].flags & FUSE_BUF_IS_FD));
+        tmpbufv.buf[0].mem = ((char *)arg) + arg_size;
+        tmpbufv.buf[0].size -= sizeof(struct fuse_in_header) + arg_size;
         pbufv = &tmpbufv;
     } else {
         /*
@@ -1043,6 +1042,13 @@ static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid, const void *inarg,
         ibufv->buf[0].size = 0;
     }
 
+    if (fuse_buf_size(pbufv) != arg->size) {
+        fuse_log(FUSE_LOG_ERR,
+                 "fuse: do_write_buf: buffer size doesn't match arg->size\n");
+        fuse_reply_err(req, EIO);
+        return;
+    }
+
     se->op.write_buf(req, nodeid, pbufv, arg->offset, &fi);
 }
 
@@ -2052,12 +2058,17 @@ void fuse_session_process_buf_int(struct fuse_session *se,
                                   struct fuse_chan *ch)
 {
     const struct fuse_buf *buf = bufv->buf;
+    struct fuse_mbuf_iter iter = FUSE_MBUF_ITER_INIT(buf);
     struct fuse_in_header *in;
     const void *inarg;
     struct fuse_req *req;
     int err;
 
-    in = buf->mem;
+    /* The first buffer must be a memory buffer */
+    assert(!(buf->flags & FUSE_BUF_IS_FD));
+
+    in = fuse_mbuf_iter_advance(&iter, sizeof(*in));
+    assert(in); /* caller guarantees the input buffer is large enough */
 
     if (se->debug) {
         fuse_log(FUSE_LOG_DEBUG,
@@ -2129,7 +2140,7 @@ void fuse_session_process_buf_int(struct fuse_session *se,
 
     inarg = (void *)&in[1];
     if (in->opcode == FUSE_WRITE && se->op.write_buf) {
-        do_write_buf(req, in->nodeid, inarg, bufv);
+        do_write_buf(req, in->nodeid, &iter, bufv);
     } else {
         fuse_ll_ops[in->opcode].func(req, in->nodeid, inarg);
     }
Signature · 1 line
2.24.1
#89 lore raw

[PULL 049/108] virtiofsd: sandbox mount namespace

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Use a mount namespace with the shared directory tree mounted at "/" and no other mounts.

This prevents symlink escape attacks because symlink targets are resolved only against the shared directory and cannot go outside it.

---
 tools/virtiofsd/passthrough_ll.c | 89 ++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)
tools/virtiofsd/passthrough_ll.c +89 -0
index e2e2211ea1..0570453eef 100644
@@ -50,6 +50,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/file.h>
+#include <sys/mount.h>
 #include <sys/syscall.h>
 #include <sys/xattr.h>
 #include <unistd.h>
@@ -1943,6 +1944,58 @@ static void print_capabilities(void)
     printf("}\n");
 }
 
+/* This magic is based on lxc's lxc_pivot_root() */
+static void setup_pivot_root(const char *source)
+{
+    int oldroot;
+    int newroot;
+
+    oldroot = open("/", O_DIRECTORY | O_RDONLY | O_CLOEXEC);
+    if (oldroot < 0) {
+        fuse_log(FUSE_LOG_ERR, "open(/): %m\n");
+        exit(1);
+    }
+
+    newroot = open(source, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
+    if (newroot < 0) {
+        fuse_log(FUSE_LOG_ERR, "open(%s): %m\n", source);
+        exit(1);
+    }
+
+    if (fchdir(newroot) < 0) {
+        fuse_log(FUSE_LOG_ERR, "fchdir(newroot): %m\n");
+        exit(1);
+    }
+
+    if (syscall(__NR_pivot_root, ".", ".") < 0) {
+        fuse_log(FUSE_LOG_ERR, "pivot_root(., .): %m\n");
+        exit(1);
+    }
+
+    if (fchdir(oldroot) < 0) {
+        fuse_log(FUSE_LOG_ERR, "fchdir(oldroot): %m\n");
+        exit(1);
+    }
+
+    if (mount("", ".", "", MS_SLAVE | MS_REC, NULL) < 0) {
+        fuse_log(FUSE_LOG_ERR, "mount(., MS_SLAVE | MS_REC): %m\n");
+        exit(1);
+    }
+
+    if (umount2(".", MNT_DETACH) < 0) {
+        fuse_log(FUSE_LOG_ERR, "umount2(., MNT_DETACH): %m\n");
+        exit(1);
+    }
+
+    if (fchdir(newroot) < 0) {
+        fuse_log(FUSE_LOG_ERR, "fchdir(newroot): %m\n");
+        exit(1);
+    }
+
+    close(newroot);
+    close(oldroot);
+}
+
 static void setup_proc_self_fd(struct lo_data *lo)
 {
     lo->proc_self_fd = open("/proc/self/fd", O_PATH);
@@ -1952,6 +2005,39 @@ static void setup_proc_self_fd(struct lo_data *lo)
     }
 }
 
+/*
+ * Make the source directory our root so symlinks cannot escape and no other
+ * files are accessible.
+ */
+static void setup_mount_namespace(const char *source)
+{
+    if (unshare(CLONE_NEWNS) != 0) {
+        fuse_log(FUSE_LOG_ERR, "unshare(CLONE_NEWNS): %m\n");
+        exit(1);
+    }
+
+    if (mount(NULL, "/", NULL, MS_REC | MS_SLAVE, NULL) < 0) {
+        fuse_log(FUSE_LOG_ERR, "mount(/, MS_REC|MS_PRIVATE): %m\n");
+        exit(1);
+    }
+
+    if (mount(source, source, NULL, MS_BIND, NULL) < 0) {
+        fuse_log(FUSE_LOG_ERR, "mount(%s, %s, MS_BIND): %m\n", source, source);
+        exit(1);
+    }
+
+    setup_pivot_root(source);
+}
+
+/*
+ * Lock down this process to prevent access to other processes or files outside
+ * source directory.  This reduces the impact of arbitrary code execution bugs.
+ */
+static void setup_sandbox(struct lo_data *lo)
+{
+    setup_mount_namespace(lo->source);
+}
+
 int main(int argc, char *argv[])
 {
     struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
@@ -2052,6 +2138,7 @@ int main(int argc, char *argv[])
     }
 
     lo.root.fd = open(lo.source, O_PATH);
+
     if (lo.root.fd == -1) {
         fuse_log(FUSE_LOG_ERR, "open(\"%s\", O_PATH): %m\n", lo.source);
         exit(1);
@@ -2075,6 +2162,8 @@ int main(int argc, char *argv[])
     /* Must be after daemonize to get the right /proc/self/fd */
     setup_proc_self_fd(&lo);
 
+    setup_sandbox(&lo);
+
     /* Block until ctrl+c or fusermount -u */
     ret = virtio_loop(se);
 
Signature · 1 line
2.24.1
#90 lore raw

[PULL 050/108] virtiofsd: move to an empty network namespace

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

If the process is compromised there should be no network access. Use an empty network namespace to sandbox networking.

---
 tools/virtiofsd/passthrough_ll.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tools/virtiofsd/passthrough_ll.c +14 -0
index 0570453eef..27ab328722 100644
@@ -1944,6 +1944,19 @@ static void print_capabilities(void)
     printf("}\n");
 }
 
+/*
+ * Called after our UNIX domain sockets have been created, now we can move to
+ * an empty network namespace to prevent TCP/IP and other network activity in
+ * case this process is compromised.
+ */
+static void setup_net_namespace(void)
+{
+    if (unshare(CLONE_NEWNET) != 0) {
+        fuse_log(FUSE_LOG_ERR, "unshare(CLONE_NEWNET): %m\n");
+        exit(1);
+    }
+}
+
 /* This magic is based on lxc's lxc_pivot_root() */
 static void setup_pivot_root(const char *source)
 {
@@ -2035,6 +2048,7 @@ static void setup_mount_namespace(const char *source)
  */
 static void setup_sandbox(struct lo_data *lo)
 {
+    setup_net_namespace();
     setup_mount_namespace(lo->source);
 }
 
Signature · 1 line
2.24.1
#91 lore raw

[PULL 052/108] virtiofsd: add seccomp whitelist

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Only allow system calls that are needed by virtiofsd. All other system calls cause SIGSYS to be directed at the thread and the process will coredump.

Restricting system calls reduces the kernel attack surface and limits what the process can do when compromised.

with additional entries by:

---
 Makefile                         |   5 +-
 tools/virtiofsd/Makefile.objs    |   5 +-
 tools/virtiofsd/passthrough_ll.c |   2 +
 tools/virtiofsd/seccomp.c        | 151 +++++++++++++++++++++++++++++++
 tools/virtiofsd/seccomp.h        |  14 +++
 5 files changed, 174 insertions(+), 3 deletions(-)
 create mode 100644 tools/virtiofsd/seccomp.c
 create mode 100644 tools/virtiofsd/seccomp.h
Makefile +3 -2
index 2f81271ee7..ad400f36b2 100644
@@ -327,7 +327,7 @@ HELPERS-y += vhost-user-gpu$(EXESUF)
 vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
 endif
 
-ifdef CONFIG_LINUX
+ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP),yy)
 HELPERS-y += virtiofsd$(EXESUF)
 vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
 endif
@@ -674,7 +674,8 @@ rdmacm-mux$(EXESUF): LIBS += "-libumad"
 rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $^)
 
-ifdef CONFIG_LINUX # relies on Linux-specific syscalls
+# relies on Linux-specific syscalls
+ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP),yy)
 virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
 	$(call LINK, $^)
 endif
tools/virtiofsd/Makefile.objs +4 -1
index 45a807500d..076f667e46 100644
@@ -5,5 +5,8 @@ virtiofsd-obj-y = buffer.o \
                   fuse_signals.o \
                   fuse_virtio.o \
                   helper.o \
-                  passthrough_ll.o
+                  passthrough_ll.o \
+                  seccomp.o
 
+seccomp.o-cflags := $(SECCOMP_CFLAGS)
+seccomp.o-libs := $(SECCOMP_LIBS)
tools/virtiofsd/passthrough_ll.c +2 -0
index 0947d14e5b..bd8925bd83 100644
@@ -59,6 +59,7 @@
 #include <unistd.h>
 
 #include "passthrough_helpers.h"
+#include "seccomp.h"
 
 struct lo_map_elem {
     union {
@@ -2091,6 +2092,7 @@ static void setup_sandbox(struct lo_data *lo, struct fuse_session *se)
 {
     setup_namespaces(lo, se);
     setup_mounts(lo->source);
+    setup_seccomp();
 }
 
 int main(int argc, char *argv[])
tools/virtiofsd/seccomp.c new file +151 -0

151 lines not on this page · raw message

tools/virtiofsd/seccomp.h new file +14 -0
new file mode 100644
index 0000000000..86bce72652
@@ -0,0 +1,14 @@
+/*
+ * Seccomp sandboxing for virtiofsd
+ *
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef VIRTIOFSD_SECCOMP_H
+#define VIRTIOFSD_SECCOMP_H
+
+void setup_seccomp(void);
+
+#endif /* VIRTIOFSD_SECCOMP_H */
Signature · 1 line
2.24.1
#92 lore raw

[PULL 062/108] virtiofsd: Handle reinit

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Allow init->destroy->init for mount->umount->mount

---
 tools/virtiofsd/fuse_lowlevel.c | 2 ++
 1 file changed, 2 insertions(+)
tools/virtiofsd/fuse_lowlevel.c +2 -0
index a7a19685b5..7d742b5a72 100644
@@ -2028,6 +2028,7 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid,
     }
 
     se->got_init = 1;
+    se->got_destroy = 0;
     if (se->op.init) {
         se->op.init(se->userdata, &se->conn);
     }
@@ -2130,6 +2131,7 @@ static void do_destroy(fuse_req_t req, fuse_ino_t nodeid,
     (void)iter;
 
     se->got_destroy = 1;
+    se->got_init = 0;
     if (se->op.destroy) {
         se->op.destroy(se->userdata);
     }
Signature · 1 line
2.24.1
#93 lore raw

[PULL 067/108] virtiofsd: passthrough_ll: add renameat2 support

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

---
 tools/virtiofsd/passthrough_ll.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/virtiofsd/passthrough_ll.c +10 -0
index 98114a3f4a..18d69abcbc 100644
@@ -1099,7 +1099,17 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
     }
 
     if (flags) {
+#ifndef SYS_renameat2
         fuse_reply_err(req, EINVAL);
+#else
+        res = syscall(SYS_renameat2, lo_fd(req, parent), name,
+                       lo_fd(req, newparent), newname, flags);
+        if (res == -1 && errno == ENOSYS) {
+            fuse_reply_err(req, EINVAL);
+        } else {
+            fuse_reply_err(req, res == -1 ? errno : 0);
+        }
+#endif
         return;
     }
 
Signature · 1 line
2.24.1
#94 lore raw

[PULL 074/108] virtiofsd: passthrough_ll: use hashtable

In reply to Dr. David Alan Gilbert (git)

From: Miklos Szeredi <[email protected]>

Improve performance of inode lookup by using a hash table.

---
 tools/virtiofsd/passthrough_ll.c | 81 ++++++++++++++++++--------------
 1 file changed, 45 insertions(+), 36 deletions(-)
tools/virtiofsd/passthrough_ll.c +45 -36
index b40f2874a7..b176a314d6 100644
@@ -84,13 +84,15 @@ struct lo_map {
     ssize_t freelist;
 };
 
+struct lo_key {
+    ino_t ino;
+    dev_t dev;
+};
+
 struct lo_inode {
-    struct lo_inode *next; /* protected by lo->mutex */
-    struct lo_inode *prev; /* protected by lo->mutex */
     int fd;
     bool is_symlink;
-    ino_t ino;
-    dev_t dev;
+    struct lo_key key;
     uint64_t refcount; /* protected by lo->mutex */
     fuse_ino_t fuse_ino;
 };
@@ -119,7 +121,8 @@ struct lo_data {
     int timeout_set;
     int readdirplus_set;
     int readdirplus_clear;
-    struct lo_inode root; /* protected by lo->mutex */
+    struct lo_inode root;
+    GHashTable *inodes; /* protected by lo->mutex */
     struct lo_map ino_map; /* protected by lo->mutex */
     struct lo_map dirp_map; /* protected by lo->mutex */
     struct lo_map fd_map; /* protected by lo->mutex */
@@ -573,7 +576,7 @@ retry:
         }
         goto fail_unref;
     }
-    if (stat.st_dev != inode->dev || stat.st_ino != inode->ino) {
+    if (stat.st_dev != inode->key.dev || stat.st_ino != inode->key.ino) {
         if (!retries) {
             fuse_log(FUSE_LOG_WARNING,
                      "%s: failed to match last\n", __func__);
@@ -753,19 +756,20 @@ out_err:
 static struct lo_inode *lo_find(struct lo_data *lo, struct stat *st)
 {
     struct lo_inode *p;
-    struct lo_inode *ret = NULL;
+    struct lo_key key = {
+        .ino = st->st_ino,
+        .dev = st->st_dev,
+    };
 
     pthread_mutex_lock(&lo->mutex);
-    for (p = lo->root.next; p != &lo->root; p = p->next) {
-        if (p->ino == st->st_ino && p->dev == st->st_dev) {
-            assert(p->refcount > 0);
-            ret = p;
-            ret->refcount++;
-            break;
-        }
+    p = g_hash_table_lookup(lo->inodes, &key);
+    if (p) {
+        assert(p->refcount > 0);
+        p->refcount++;
     }
     pthread_mutex_unlock(&lo->mutex);
-    return ret;
+
+    return p;
 }
 
 static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
@@ -810,8 +814,6 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         close(newfd);
         newfd = -1;
     } else {
-        struct lo_inode *prev, *next;
-
         saverr = ENOMEM;
         inode = calloc(1, sizeof(struct lo_inode));
         if (!inode) {
@@ -822,17 +824,12 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         inode->refcount = 1;
         inode->fd = newfd;
         newfd = -1;
-        inode->ino = e->attr.st_ino;
-        inode->dev = e->attr.st_dev;
+        inode->key.ino = e->attr.st_ino;
+        inode->key.dev = e->attr.st_dev;
 
         pthread_mutex_lock(&lo->mutex);
         inode->fuse_ino = lo_add_inode_mapping(req, inode);
-        prev = &lo->root;
-        next = prev->next;
-        next->prev = inode;
-        inode->next = next;
-        inode->prev = prev;
-        prev->next = inode;
+        g_hash_table_insert(lo->inodes, &inode->key, inode);
         pthread_mutex_unlock(&lo->mutex);
     }
     e->ino = inode->fuse_ino;
@@ -1162,14 +1159,8 @@ static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
     assert(inode->refcount >= n);
     inode->refcount -= n;
     if (!inode->refcount) {
-        struct lo_inode *prev, *next;
-
-        prev = inode->prev;
-        next = inode->next;
-        next->prev = prev;
-        prev->next = next;
-
         lo_map_remove(&lo->ino_map, inode->fuse_ino);
+        g_hash_table_remove(lo->inodes, &inode->key);
         pthread_mutex_unlock(&lo->mutex);
         close(inode->fd);
         free(inode);
@@ -1369,7 +1360,7 @@ static void lo_do_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
 
         /* Hide root's parent directory */
         if (dinode == &lo->root && strcmp(name, "..") == 0) {
-            e.attr.st_ino = lo->root.ino;
+            e.attr.st_ino = lo->root.key.ino;
             e.attr.st_mode = DT_DIR << 12;
         }
 
@@ -2370,11 +2361,26 @@ static void setup_root(struct lo_data *lo, struct lo_inode *root)
 
     root->is_symlink = false;
     root->fd = fd;
-    root->ino = stat.st_ino;
-    root->dev = stat.st_dev;
+    root->key.ino = stat.st_ino;
+    root->key.dev = stat.st_dev;
     root->refcount = 2;
 }
 
+static guint lo_key_hash(gconstpointer key)
+{
+    const struct lo_key *lkey = key;
+
+    return (guint)lkey->ino + (guint)lkey->dev;
+}
+
+static gboolean lo_key_equal(gconstpointer a, gconstpointer b)
+{
+    const struct lo_key *la = a;
+    const struct lo_key *lb = b;
+
+    return la->ino == lb->ino && la->dev == lb->dev;
+}
+
 int main(int argc, char *argv[])
 {
     struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
@@ -2392,7 +2398,7 @@ int main(int argc, char *argv[])
     umask(0);
 
     pthread_mutex_init(&lo.mutex, NULL);
-    lo.root.next = lo.root.prev = &lo.root;
+    lo.inodes = g_hash_table_new(lo_key_hash, lo_key_equal);
     lo.root.fd = -1;
     lo.root.fuse_ino = FUSE_ROOT_ID;
     lo.cache = CACHE_AUTO;
@@ -2522,6 +2528,9 @@ err_out2:
 err_out1:
     fuse_opt_free_args(&args);
 
+    if (lo.inodes) {
+        g_hash_table_destroy(lo.inodes);
+    }
     lo_map_destroy(&lo.fd_map);
     lo_map_destroy(&lo.dirp_map);
     lo_map_destroy(&lo.ino_map);
Signature · 1 line
2.24.1
#95 lore raw

[PULL 080/108] virtiofsd: add helper for lo_data cleanup

In reply to Dr. David Alan Gilbert (git)

From: Liu Bo <[email protected]>

This offers an helper function for lo_data's cleanup.

---
 tools/virtiofsd/passthrough_ll.c | 37 ++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 16 deletions(-)
tools/virtiofsd/passthrough_ll.c +21 -16
index 056ebe8556..e8dc5c7320 100644
@@ -2407,6 +2407,26 @@ static gboolean lo_key_equal(gconstpointer a, gconstpointer b)
     return la->ino == lb->ino && la->dev == lb->dev;
 }
 
+static void fuse_lo_data_cleanup(struct lo_data *lo)
+{
+    if (lo->inodes) {
+        g_hash_table_destroy(lo->inodes);
+    }
+    lo_map_destroy(&lo->fd_map);
+    lo_map_destroy(&lo->dirp_map);
+    lo_map_destroy(&lo->ino_map);
+
+    if (lo->proc_self_fd >= 0) {
+        close(lo->proc_self_fd);
+    }
+
+    if (lo->root.fd >= 0) {
+        close(lo->root.fd);
+    }
+
+    free(lo->source);
+}
+
 int main(int argc, char *argv[])
 {
     struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
@@ -2554,22 +2574,7 @@ err_out2:
 err_out1:
     fuse_opt_free_args(&args);
 
-    if (lo.inodes) {
-        g_hash_table_destroy(lo.inodes);
-    }
-    lo_map_destroy(&lo.fd_map);
-    lo_map_destroy(&lo.dirp_map);
-    lo_map_destroy(&lo.ino_map);
-
-    if (lo.proc_self_fd >= 0) {
-        close(lo.proc_self_fd);
-    }
-
-    if (lo.root.fd >= 0) {
-        close(lo.root.fd);
-    }
-
-    free(lo.source);
+    fuse_lo_data_cleanup(&lo);
 
     return ret ? 1 : 0;
 }
Signature · 1 line
2.24.1
#96 lore raw

[PULL 084/108] Virtiofsd: fix memory leak on fuse queueinfo

In reply to Dr. David Alan Gilbert (git)

From: Liu Bo <[email protected]>

For fuse's queueinfo, both queueinfo array and queueinfos are allocated in fv_queue_set_started() but not cleaned up when the daemon process quits.

This fixes the leak in proper places.

---
 tools/virtiofsd/fuse_virtio.c | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/virtiofsd/fuse_virtio.c +8 -0
index b7948def27..fb8d6d1379 100644
@@ -625,6 +625,8 @@ static void fv_queue_cleanup_thread(struct fv_VuDev *vud, int qidx)
     }
     close(ourqi->kill_fd);
     ourqi->kick_fd = -1;
+    free(vud->qi[qidx]);
+    vud->qi[qidx] = NULL;
 }
 
 /* Callback from libvhost-user on start or stop of a queue */
@@ -884,6 +886,12 @@ int virtio_session_mount(struct fuse_session *se)
 void virtio_session_close(struct fuse_session *se)
 {
     close(se->vu_socketfd);
+
+    if (!se->virtio_dev) {
+        return;
+    }
+
+    free(se->virtio_dev->qi);
     free(se->virtio_dev);
     se->virtio_dev = NULL;
 }
Signature · 1 line
2.24.1
#97 lore raw

[PULL 086/108] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

vu_socket_path is NULL when --fd=FDNUM was used. Use fuse_lowlevel_is_virtio() instead.

---
 tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tools/virtiofsd/fuse_lowlevel.c +4 -3
index 70568d22a4..dab6a31e08 100644
@@ -2537,12 +2537,13 @@ void fuse_session_destroy(struct fuse_session *se)
         close(se->fd);
     }
 
-    if (se->vu_socket_path) {
+    if (fuse_lowlevel_is_virtio(se)) {
         virtio_session_close(se);
-        free(se->vu_socket_path);
-        se->vu_socket_path = NULL;
     }
 
+    free(se->vu_socket_path);
+    se->vu_socket_path = NULL;
+
     free(se);
 }
 
Signature · 1 line
2.24.1
#98 lore raw

[PULL 087/108] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

We call into libvhost-user from the virtqueue handler thread and the vhost-user message processing thread without a lock. There is nothing protecting the virtqueue handler thread if the vhost-user message processing thread changes the virtqueue or memory table while it is running.

This patch introduces a read-write lock. Virtqueue handler threads are readers. The vhost-user message processing thread is a writer. This will allow concurrency for multiqueue in the future while protecting against fv_queue_thread() vs virtio_loop() races.

Note that the critical sections could be made smaller but it would be more invasive and require libvhost-user changes. Let's start simple and improve performance later, if necessary. Another option would be an RCU-style approach with lighter-weight primitives.

---
 tools/virtiofsd/fuse_virtio.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
tools/virtiofsd/fuse_virtio.c +33 -1
index fb8d6d1379..f6242f9338 100644
@@ -58,6 +58,18 @@ struct fv_VuDev {
     VuDev dev;
     struct fuse_session *se;
 
+    /*
+     * Either handle virtqueues or vhost-user protocol messages.  Don't do
+     * both at the same time since that could lead to race conditions if
+     * virtqueues or memory tables change while another thread is accessing
+     * them.
+     *
+     * The assumptions are:
+     * 1. fv_queue_thread() reads/writes to virtqueues and only reads VuDev.
+     * 2. virtio_loop() reads/writes virtqueues and VuDev.
+     */
+    pthread_rwlock_t vu_dispatch_rwlock;
+
     /*
      * The following pair of fields are only accessed in the main
      * virtio_loop
@@ -415,6 +427,8 @@ static void *fv_queue_thread(void *opaque)
              qi->qidx, qi->kick_fd);
     while (1) {
         struct pollfd pf[2];
+        int ret;
+
         pf[0].fd = qi->kick_fd;
         pf[0].events = POLLIN;
         pf[0].revents = 0;
@@ -461,6 +475,9 @@ static void *fv_queue_thread(void *opaque)
             fuse_log(FUSE_LOG_ERR, "Eventfd_read for queue: %m\n");
             break;
         }
+        /* Mutual exclusion with virtio_loop() */
+        ret = pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock);
+        assert(ret == 0); /* there is no possible error case */
         /* out is from guest, in is too guest */
         unsigned int in_bytes, out_bytes;
         vu_queue_get_avail_bytes(dev, q, &in_bytes, &out_bytes, ~0, ~0);
@@ -469,6 +486,7 @@ static void *fv_queue_thread(void *opaque)
                  "%s: Queue %d gave evalue: %zx available: in: %u out: %u\n",
                  __func__, qi->qidx, (size_t)evalue, in_bytes, out_bytes);
 
+
         while (1) {
             bool allocated_bufv = false;
             struct fuse_bufvec bufv;
@@ -597,6 +615,8 @@ static void *fv_queue_thread(void *opaque)
             free(elem);
             elem = NULL;
         }
+
+        pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock);
     }
 out:
     pthread_mutex_destroy(&ch.lock);
@@ -711,6 +731,8 @@ int virtio_loop(struct fuse_session *se)
 
     while (!fuse_session_exited(se)) {
         struct pollfd pf[1];
+        bool ok;
+        int ret;
         pf[0].fd = se->vu_socketfd;
         pf[0].events = POLLIN;
         pf[0].revents = 0;
@@ -735,7 +757,15 @@ int virtio_loop(struct fuse_session *se)
         }
         assert(pf[0].revents & POLLIN);
         fuse_log(FUSE_LOG_DEBUG, "%s: Got VU event\n", __func__);
-        if (!vu_dispatch(&se->virtio_dev->dev)) {
+        /* Mutual exclusion with fv_queue_thread() */
+        ret = pthread_rwlock_wrlock(&se->virtio_dev->vu_dispatch_rwlock);
+        assert(ret == 0); /* there is no possible error case */
+
+        ok = vu_dispatch(&se->virtio_dev->dev);
+
+        pthread_rwlock_unlock(&se->virtio_dev->vu_dispatch_rwlock);
+
+        if (!ok) {
             fuse_log(FUSE_LOG_ERR, "%s: vu_dispatch failed\n", __func__);
             break;
         }
@@ -877,6 +907,7 @@ int virtio_session_mount(struct fuse_session *se)
 
     se->vu_socketfd = data_sock;
     se->virtio_dev->se = se;
+    pthread_rwlock_init(&se->virtio_dev->vu_dispatch_rwlock, NULL);
     vu_init(&se->virtio_dev->dev, 2, se->vu_socketfd, fv_panic, fv_set_watch,
             fv_remove_watch, &fv_iface);
 
@@ -892,6 +923,7 @@ void virtio_session_close(struct fuse_session *se)
     }
 
     free(se->virtio_dev->qi);
+    pthread_rwlock_destroy(&se->virtio_dev->vu_dispatch_rwlock);
     free(se->virtio_dev);
     se->virtio_dev = NULL;
 }
Signature · 1 line
2.24.1
#99 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 9 lines · * Dr. David Alan Gilbert (git) ([email protected]) wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

The following changes since commit b7c359c748a2e3ccb97a184b9739feb2cd48de2f:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging (2020-01-23 14:38:43 +0000)

are available in the Git repository at:

[email protected]:dagrh/qemu.git tags/pull-virtiofs-20200123b

Note the public URI is:

https://gitlab.com/dagrh/qemu.git

Dave

Quoted 202 lines

for you to fetch changes up to 1d59b1b210d7c3b0bdf4b10ebe0bb1fccfcb8b95:

virtiofsd: add some options to the help message (2020-01-23 16:41:37 +0000)

----------------------------------------------------------------
virtiofsd first pull v2

Import our virtiofsd.
This pulls in the daemon to drive a file system connected to the existing qemu virtiofsd device.
It's derived from upstream libfuse with lots of changes (and a lot trimmed out).
The daemon lives in the newly created qemu/tools/virtiofsd

v2
drop the docs while we discuss where they should live and we need to redo the manpage in anything but texi

----------------------------------------------------------------
Dr. David Alan Gilbert (34):
virtiofsd: Pull in upstream headers
virtiofsd: Pull in kernel's fuse.h
virtiofsd: Add auxiliary .c's
virtiofsd: Add fuse_lowlevel.c
virtiofsd: Add passthrough_ll
virtiofsd: Trim down imported files
virtiofsd: Format imported files to qemu style
virtiofsd: Fix fuse_daemonize ignored return values
virtiofsd: Fix common header and define for QEMU builds
virtiofsd: Trim out compatibility code
virtiofsd: Add options for virtio
virtiofsd: Open vhost connection instead of mounting
virtiofsd: Start wiring up vhost-user
virtiofsd: Add main virtio loop
virtiofsd: get/set features callbacks
virtiofsd: Start queue threads
virtiofsd: Poll kick_fd for queue
virtiofsd: Start reading commands from queue
virtiofsd: Send replies to messages
virtiofsd: Keep track of replies
virtiofsd: Add Makefile wiring for virtiofsd contrib
virtiofsd: Fast path for virtio read
virtiofs: Add maintainers entry
virtiofsd: Plumb fuse_bufvec through to do_write_buf
virtiofsd: Pass write iov's all the way through
virtiofsd: cap-ng helpers
virtiofsd: Handle reinit
virtiofsd: Handle hard reboot
virtiofsd: Kill threads when queues are stopped
vhost-user: Print unexpected slave message types contrib/libvhost-user: Protect slave fd with mutex
virtiofsd: Clean up inodes on destroy
libvhost-user: Fix some memtable remap cases
virtiofsd: Convert lo_destroy to take the lo->mutex lock itself

Eric Ren (1):
virtiofsd: fix incorrect error handling in lo_do_lookup

Eryu Guan (3):
virtiofsd: print log only when priority is high enough
virtiofsd: convert more fprintf and perror to use fuse log infra
virtiofsd: stop all queue threads on exit in virtio_loop()

Jiufei Xue (1):
virtiofsd: support nanosecond resolution for file timestamp

Liu Bo (6):
virtiofsd: fix error handling in main()
virtiofsd: cleanup allocated resource in se
virtiofsd: fix memory leak on lo.source
virtiofsd: add helper for lo_data cleanup
virtiofsd: enable PARALLEL_DIROPS during INIT
Virtiofsd: fix memory leak on fuse queueinfo

Masayoshi Mizuma (4):
virtiofsd: Add ID to the log with FUSE_LOG_DEBUG level
virtiofsd: Add timestamp to the log with FUSE_LOG_DEBUG level
virtiofsd: Prevent multiply running with same vhost_user_socket
virtiofsd: add some options to the help message

Miklos Szeredi (10):
virtiofsd: passthrough_ll: add fallback for racy ops
virtiofsd: passthrough_ll: add renameat2 support
virtiofsd: passthrough_ll: disable readdirplus on cache=never
virtiofsd: passthrough_ll: control readdirplus
virtiofsd: rename unref_inode() to unref_inode_lolocked()
virtiofsd: fail when parent inode isn't known in lo_do_lookup()
virtiofsd: extract root inode init into setup_root()
virtiofsd: passthrough_ll: clean up cache related options
virtiofsd: passthrough_ll: use hashtable
virtiofsd: passthrough_ll: fix refcounting on remove/rename

Misono Tomohiro (2):
virtiofsd: Fix data corruption with O_APPEND write in writeback mode
virtiofsd: passthrough_ll: Use cache_readdir for directory open

Peng Tao (1):
virtiofsd: do not always set FUSE_FLOCK_LOCKS

Stefan Hajnoczi (35):
virtiofsd: remove mountpoint dummy argument
virtiofsd: remove unused notify reply support
virtiofsd: add -o source=PATH to help output
virtiofsd: add --fd=FDNUM fd passing option
virtiofsd: make -f (foreground) the default
virtiofsd: add vhost-user.json file
virtiofsd: add --print-capabilities option
virtiofsd: passthrough_ll: add lo_map for ino/fh indirection
virtiofsd: passthrough_ll: add ino_map to hide lo_inode pointers
virtiofsd: passthrough_ll: add dirp_map to hide lo_dirp pointers
virtiofsd: passthrough_ll: add fd_map to hide file descriptors
virtiofsd: validate path components
virtiofsd: add fuse_mbuf_iter API
virtiofsd: validate input buffer sizes in do_write_buf()
virtiofsd: check input buffer size in fuse_lowlevel.c ops
virtiofsd: prevent ".." escape in lo_do_lookup()
virtiofsd: prevent ".." escape in lo_do_readdir()
virtiofsd: use /proc/self/fd/ O_PATH file descriptor
virtiofsd: sandbox mount namespace
virtiofsd: move to an empty network namespace
virtiofsd: move to a new pid namespace
virtiofsd: add seccomp whitelist
virtiofsd: set maximum RLIMIT_NOFILE limit
virtiofsd: fix libfuse information leaks
virtiofsd: add --syslog command-line option
virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()
virtiofsd: prevent fv_queue_thread() vs virtio_loop() races
virtiofsd: make lo_release() atomic
virtiofsd: prevent races with lo_dirp_put()
virtiofsd: rename inode->refcount to inode->nlookup
virtiofsd: introduce inode refcount to prevent use-after-free
virtiofsd: process requests in a thread pool
virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races
virtiofsd: fix lo_destroy() resource leaks
virtiofsd: add --thread-pool-size=NUM option

Vivek Goyal (6):
virtiofsd: Make fsync work even if only inode is passed in
virtiofsd: passthrough_ll: create new files in caller's context
virtiofsd: Parse flag FUSE_WRITE_KILL_PRIV
virtiofsd: Drop CAP_FSETID if client asked for it
virtiofsd: Support remote posix locks
virtiofsd: Reset O_DIRECT flag during file open

Xiao Yang (3):
virtiofsd: Remove unused enum fuse_buf_copy_flags vitriofsd/passthrough_ll: fix fallocate() ifdefs virtiofsd/passthrough_ll: Pass errno to fuse_reply_err()

piaojun (2):
virtiofsd: add definition of fuse_buf_writev()
virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance

 .gitignore                                |    1 +
 MAINTAINERS                               |    8 +
 Makefile                                  |   12 +
 Makefile.objs                             |    1 +
 configure                                 |   16 +
 contrib/libvhost-user/libvhost-user.c     |   57 +-
 contrib/libvhost-user/libvhost-user.h     |    6 +
 docs/interop/vhost-user.json              |    4 +-
 hw/virtio/vhost-user.c                    |    2 +-
 include/standard-headers/linux/fuse.h     |  891 +++++++++
 scripts/update-linux-headers.sh           |    1 +
 tools/virtiofsd/50-qemu-virtiofsd.json.in |    5 +
 tools/virtiofsd/Makefile.objs             |   12 +
 tools/virtiofsd/buffer.c                  |  351 ++++
 tools/virtiofsd/fuse.h                    | 1249 ++++++++++++
 tools/virtiofsd/fuse_common.h             |  816 ++++++++
 tools/virtiofsd/fuse_i.h                  |  115 ++
 tools/virtiofsd/fuse_log.c                |   41 +
 tools/virtiofsd/fuse_log.h                |   74 +
 tools/virtiofsd/fuse_lowlevel.c           | 2761 ++++++++++++++++++++++++++
 tools/virtiofsd/fuse_lowlevel.h           | 1991 +++++++++++++++++++
 tools/virtiofsd/fuse_misc.h               |   60 +
 tools/virtiofsd/fuse_opt.c                |  450 +++++
 tools/virtiofsd/fuse_opt.h                |  272 +++
 tools/virtiofsd/fuse_signals.c            |   98 +
 tools/virtiofsd/fuse_virtio.c             |  986 ++++++++++
 tools/virtiofsd/fuse_virtio.h             |   33 +
 tools/virtiofsd/helper.c                  |  349 ++++
 tools/virtiofsd/passthrough_helpers.h     |   51 +
 tools/virtiofsd/passthrough_ll.c          | 3006 +++++++++++++++++++++++++++++
 tools/virtiofsd/seccomp.c                 |  165 ++
 tools/virtiofsd/seccomp.h                 |   16 +
 32 files changed, 13886 insertions(+), 14 deletions(-)
 create mode 100644 include/standard-headers/linux/fuse.h
 create mode 100644 tools/virtiofsd/50-qemu-virtiofsd.json.in
 create mode 100644 tools/virtiofsd/Makefile.objs
 create mode 100644 tools/virtiofsd/buffer.c
 create mode 100644 tools/virtiofsd/fuse.h
 create mode 100644 tools/virtiofsd/fuse_common.h
 create mode 100644 tools/virtiofsd/fuse_i.h
 create mode 100644 tools/virtiofsd/fuse_log.c
 create mode 100644 tools/virtiofsd/fuse_log.h
 create mode 100644 tools/virtiofsd/fuse_lowlevel.c
 create mode 100644 tools/virtiofsd/fuse_lowlevel.h
 create mode 100644 tools/virtiofsd/fuse_misc.h
 create mode 100644 tools/virtiofsd/fuse_opt.c
 create mode 100644 tools/virtiofsd/fuse_opt.h
Quoted 10 lines
 create mode 100644 tools/virtiofsd/fuse_signals.c
 create mode 100644 tools/virtiofsd/fuse_virtio.c
 create mode 100644 tools/virtiofsd/fuse_virtio.h
 create mode 100644 tools/virtiofsd/helper.c
 create mode 100644 tools/virtiofsd/passthrough_helpers.h
 create mode 100644 tools/virtiofsd/passthrough_ll.c
 create mode 100644 tools/virtiofsd/seccomp.c
 create mode 100644 tools/virtiofsd/seccomp.h

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#100 lore raw
Quoted 8 lines · Dr. David Alan Gilbert
Quoted 6 lines · * Dr. David Alan Gilbert (git) ([email protected]) wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

The following changes since commit b7c359c748a2e3ccb97a184b9739feb2cd48de2f:

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging (2020-01-23 14:38:43 +0000)

Quoted 7 lines
Quoted 3 lines

are available in the Git repository at:

[email protected]:dagrh/qemu.git tags/pull-virtiofs-20200123b

Note the public URI is:

https://gitlab.com/dagrh/qemu.git

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM

#101 lore raw

[PULL 088/108] virtiofsd: make lo_release() atomic

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Hold the lock across both lo_map_get() and lo_map_remove() to prevent races between two FUSE_RELEASE requests. In this case I don't see a serious bug but it's safer to do things atomically.

---
 tools/virtiofsd/passthrough_ll.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
tools/virtiofsd/passthrough_ll.c +8 -4
index 9414935b52..690edbc4c5 100644
@@ -1772,14 +1772,18 @@ static void lo_release(fuse_req_t req, fuse_ino_t ino,
                        struct fuse_file_info *fi)
 {
     struct lo_data *lo = lo_data(req);
-    int fd;
+    struct lo_map_elem *elem;
+    int fd = -1;
 
     (void)ino;
 
-    fd = lo_fi_fd(req, fi);
-
     pthread_mutex_lock(&lo->mutex);
-    lo_map_remove(&lo->fd_map, fi->fh);
+    elem = lo_map_get(&lo->fd_map, fi->fh);
+    if (elem) {
+        fd = elem->fd;
+        elem = NULL;
+        lo_map_remove(&lo->fd_map, fi->fh);
+    }
     pthread_mutex_unlock(&lo->mutex);
 
     close(fd);
Signature · 1 line
2.24.1
#102 lore raw

[PULL 090/108] virtiofsd: rename inode->refcount to inode->nlookup

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

This reference counter plays a specific role in the FUSE protocol. It's not a generic object reference counter and the FUSE kernel code calls it "nlookup".

---
 tools/virtiofsd/passthrough_ll.c | 37 +++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 12 deletions(-)
tools/virtiofsd/passthrough_ll.c +25 -12
index 2d703b57e5..c819b5f782 100644
@@ -99,7 +99,20 @@ struct lo_inode {
     int fd;
     bool is_symlink;
     struct lo_key key;
-    uint64_t refcount; /* protected by lo->mutex */
+
+    /*
+     * This counter keeps the inode alive during the FUSE session.
+     * Incremented when the FUSE inode number is sent in a reply
+     * (FUSE_LOOKUP, FUSE_READDIRPLUS, etc).  Decremented when an inode is
+     * released by requests like FUSE_FORGET, FUSE_RMDIR, FUSE_RENAME, etc.
+     *
+     * Note that this value is untrusted because the client can manipulate
+     * it arbitrarily using FUSE_FORGET requests.
+     *
+     * Protected by lo->mutex.
+     */
+    uint64_t nlookup;
+
     fuse_ino_t fuse_ino;
     pthread_mutex_t plock_mutex;
     GHashTable *posix_locks; /* protected by lo_inode->plock_mutex */
@@ -568,7 +581,7 @@ retry:
     if (last == path) {
         p = &lo->root;
         pthread_mutex_lock(&lo->mutex);
-        p->refcount++;
+        p->nlookup++;
         pthread_mutex_unlock(&lo->mutex);
     } else {
         *last = '\0';
@@ -786,8 +799,8 @@ static struct lo_inode *lo_find(struct lo_data *lo, struct stat *st)
     pthread_mutex_lock(&lo->mutex);
     p = g_hash_table_lookup(lo->inodes, &key);
     if (p) {
-        assert(p->refcount > 0);
-        p->refcount++;
+        assert(p->nlookup > 0);
+        p->nlookup++;
     }
     pthread_mutex_unlock(&lo->mutex);
 
@@ -855,7 +868,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         }
 
         inode->is_symlink = S_ISLNK(e->attr.st_mode);
-        inode->refcount = 1;
+        inode->nlookup = 1;
         inode->fd = newfd;
         newfd = -1;
         inode->key.ino = e->attr.st_ino;
@@ -1112,7 +1125,7 @@ static void lo_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t parent,
     }
 
     pthread_mutex_lock(&lo->mutex);
-    inode->refcount++;
+    inode->nlookup++;
     pthread_mutex_unlock(&lo->mutex);
     e.ino = inode->fuse_ino;
 
@@ -1193,9 +1206,9 @@ static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
     }
 
     pthread_mutex_lock(&lo->mutex);
-    assert(inode->refcount >= n);
-    inode->refcount -= n;
-    if (!inode->refcount) {
+    assert(inode->nlookup >= n);
+    inode->nlookup -= n;
+    if (!inode->nlookup) {
         lo_map_remove(&lo->ino_map, inode->fuse_ino);
         g_hash_table_remove(lo->inodes, &inode->key);
         if (g_hash_table_size(inode->posix_locks)) {
@@ -1216,7 +1229,7 @@ static int unref_all_inodes_cb(gpointer key, gpointer value, gpointer user_data)
     struct lo_inode *inode = value;
     struct lo_data *lo = user_data;
 
-    inode->refcount = 0;
+    inode->nlookup = 0;
     lo_map_remove(&lo->ino_map, inode->fuse_ino);
     close(inode->fd);
 
@@ -1241,7 +1254,7 @@ static void lo_forget_one(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
     }
 
     fuse_log(FUSE_LOG_DEBUG, "  forget %lli %lli -%lli\n",
-             (unsigned long long)ino, (unsigned long long)inode->refcount,
+             (unsigned long long)ino, (unsigned long long)inode->nlookup,
              (unsigned long long)nlookup);
 
     unref_inode_lolocked(lo, inode, nlookup);
@@ -2609,7 +2622,7 @@ static void setup_root(struct lo_data *lo, struct lo_inode *root)
     root->fd = fd;
     root->key.ino = stat.st_ino;
     root->key.dev = stat.st_dev;
-    root->refcount = 2;
+    root->nlookup = 2;
 }
 
 static guint lo_key_hash(gconstpointer key)
Signature · 1 line
2.24.1
#103 lore raw

[PULL 091/108] libvhost-user: Fix some memtable remap cases

In reply to Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

If a new setmemtable command comes in once the vhost threads are running, it will remap the guests address space and the threads will now be looking in the wrong place.

Fortunately we're running this command under lock, so we can update the queue mappings so that threads will look in the new-right place.

Note: This doesn't fix things that the threads might be doing without a lock (e.g. a readv/writev!) That's for another time.

---
 contrib/libvhost-user/libvhost-user.c | 33 ++++++++++++++++++++-------
 contrib/libvhost-user/libvhost-user.h |  3 +++
 2 files changed, 28 insertions(+), 8 deletions(-)
contrib/libvhost-user/libvhost-user.c +25 -8
index 63e41062a4..b89bf18501 100644
@@ -564,6 +564,21 @@ vu_reset_device_exec(VuDev *dev, VhostUserMsg *vmsg)
     return false;
 }
 
+static bool
+map_ring(VuDev *dev, VuVirtq *vq)
+{
+    vq->vring.desc = qva_to_va(dev, vq->vra.desc_user_addr);
+    vq->vring.used = qva_to_va(dev, vq->vra.used_user_addr);
+    vq->vring.avail = qva_to_va(dev, vq->vra.avail_user_addr);
+
+    DPRINT("Setting virtq addresses:\n");
+    DPRINT("    vring_desc  at %p\n", vq->vring.desc);
+    DPRINT("    vring_used  at %p\n", vq->vring.used);
+    DPRINT("    vring_avail at %p\n", vq->vring.avail);
+
+    return !(vq->vring.desc && vq->vring.used && vq->vring.avail);
+}
+
 static bool
 vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg *vmsg)
 {
@@ -767,6 +782,14 @@ vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg)
         close(vmsg->fds[i]);
     }
 
+    for (i = 0; i < dev->max_queues; i++) {
+        if (dev->vq[i].vring.desc) {
+            if (map_ring(dev, &dev->vq[i])) {
+                vu_panic(dev, "remaping queue %d during setmemtable", i);
+            }
+        }
+    }
+
     return false;
 }
 
@@ -853,18 +876,12 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)
     DPRINT("    avail_user_addr:  0x%016" PRIx64 "\n", vra->avail_user_addr);
     DPRINT("    log_guest_addr:   0x%016" PRIx64 "\n", vra->log_guest_addr);
 
+    vq->vra = *vra;
     vq->vring.flags = vra->flags;
-    vq->vring.desc = qva_to_va(dev, vra->desc_user_addr);
-    vq->vring.used = qva_to_va(dev, vra->used_user_addr);
-    vq->vring.avail = qva_to_va(dev, vra->avail_user_addr);
     vq->vring.log_guest_addr = vra->log_guest_addr;
 
-    DPRINT("Setting virtq addresses:\n");
-    DPRINT("    vring_desc  at %p\n", vq->vring.desc);
-    DPRINT("    vring_used  at %p\n", vq->vring.used);
-    DPRINT("    vring_avail at %p\n", vq->vring.avail);
 
-    if (!(vq->vring.desc && vq->vring.used && vq->vring.avail)) {
+    if (map_ring(dev, vq)) {
         vu_panic(dev, "Invalid vring_addr message");
         return false;
     }
contrib/libvhost-user/libvhost-user.h +3 -0
index 1844b6f8d4..5cb7708559 100644
@@ -327,6 +327,9 @@ typedef struct VuVirtq {
     int err_fd;
     unsigned int enable;
     bool started;
+
+    /* Guest addresses of our ring */
+    struct vhost_vring_addr vra;
 } VuVirtq;
 
 enum VuWatchCondtion {
Signature · 1 line
2.24.1
#104 lore raw

[PULL 094/108] virtiofsd: do not always set FUSE_FLOCK_LOCKS

In reply to Dr. David Alan Gilbert (git)

From: Peng Tao <[email protected]>

Right now we always enable it regardless of given commandlines. Fix it by setting the flag relying on the lo->flock bit.

---
 tools/virtiofsd/passthrough_ll.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
tools/virtiofsd/passthrough_ll.c +8 -3
index ab1613586e..ccbbec18b0 100644
@@ -546,9 +546,14 @@ static void lo_init(void *userdata, struct fuse_conn_info *conn)
         fuse_log(FUSE_LOG_DEBUG, "lo_init: activating writeback\n");
         conn->want |= FUSE_CAP_WRITEBACK_CACHE;
     }
-    if (lo->flock && conn->capable & FUSE_CAP_FLOCK_LOCKS) {
-        fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
-        conn->want |= FUSE_CAP_FLOCK_LOCKS;
+    if (conn->capable & FUSE_CAP_FLOCK_LOCKS) {
+        if (lo->flock) {
+            fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
+            conn->want |= FUSE_CAP_FLOCK_LOCKS;
+        } else {
+            fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling flock locks\n");
+            conn->want &= ~FUSE_CAP_FLOCK_LOCKS;
+        }
     }
 
     if (conn->capable & FUSE_CAP_POSIX_LOCKS) {
Signature · 1 line
2.24.1
#105 lore raw

[PULL 096/108] virtiofsd: Reset O_DIRECT flag during file open

In reply to Dr. David Alan Gilbert (git)

From: Vivek Goyal <[email protected]>

If an application wants to do direct IO and opens a file with O_DIRECT in guest, that does not necessarily mean that we need to bypass page cache on host as well. So reset this flag on host.

If somebody needs to bypass page cache on host as well (and it is safe to do so), we can add a knob in daemon later to control this behavior.

I check virtio-9p and they do reset O_DIRECT flag.

---
 tools/virtiofsd/passthrough_ll.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tools/virtiofsd/passthrough_ll.c +14 -0
index ccbbec18b0..948cb19c77 100644
@@ -1721,6 +1721,13 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
         goto out;
     }
 
+    /*
+     * O_DIRECT in guest should not necessarily mean bypassing page
+     * cache on host as well. If somebody needs that behavior, it
+     * probably should be a configuration knob in daemon.
+     */
+    fi->flags &= ~O_DIRECT;
+
     fd = openat(parent_inode->fd, name, (fi->flags | O_CREAT) & ~O_NOFOLLOW,
                 mode);
     err = fd == -1 ? errno : 0;
@@ -1950,6 +1957,13 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
         fi->flags &= ~O_APPEND;
     }
 
+    /*
+     * O_DIRECT in guest should not necessarily mean bypassing page
+     * cache on host as well. If somebody needs that behavior, it
+     * probably should be a configuration knob in daemon.
+     */
+    fi->flags &= ~O_DIRECT;
+
     sprintf(buf, "%i", lo_fd(req, ino));
     fd = openat(lo->proc_self_fd, buf, fi->flags & ~O_NOFOLLOW);
     if (fd == -1) {
Signature · 1 line
2.24.1
#106 lore raw

[PULL 097/108] virtiofsd: Fix data corruption with O_APPEND write in writeback mode

In reply to Dr. David Alan Gilbert (git)

From: Misono Tomohiro <[email protected]>

When writeback mode is enabled (-o writeback), O_APPEND handling is done in kernel. Therefore virtiofsd clears O_APPEND flag when open. Otherwise O_APPEND flag takes precedence over pwrite() and write data may corrupt.

Currently clearing O_APPEND flag is done in lo_open(), but we also need the same operation in lo_create(). So, factor out the flag update operation in lo_open() to update_open_flags() and call it in both lo_open() and lo_create().

This fixes the failure of xfstest generic/069 in writeback mode (which tests O_APPEND write data integrity).

---
 tools/virtiofsd/passthrough_ll.c | 66 ++++++++++++++++----------------
 1 file changed, 33 insertions(+), 33 deletions(-)
tools/virtiofsd/passthrough_ll.c +33 -33
index 948cb19c77..4c61ac5065 100644
@@ -1692,6 +1692,37 @@ static void lo_releasedir(fuse_req_t req, fuse_ino_t ino,
     fuse_reply_err(req, 0);
 }
 
+static void update_open_flags(int writeback, struct fuse_file_info *fi)
+{
+    /*
+     * With writeback cache, kernel may send read requests even
+     * when userspace opened write-only
+     */
+    if (writeback && (fi->flags & O_ACCMODE) == O_WRONLY) {
+        fi->flags &= ~O_ACCMODE;
+        fi->flags |= O_RDWR;
+    }
+
+    /*
+     * With writeback cache, O_APPEND is handled by the kernel.
+     * This breaks atomicity (since the file may change in the
+     * underlying filesystem, so that the kernel's idea of the
+     * end of the file isn't accurate anymore). In this example,
+     * we just accept that. A more rigorous filesystem may want
+     * to return an error here
+     */
+    if (writeback && (fi->flags & O_APPEND)) {
+        fi->flags &= ~O_APPEND;
+    }
+
+    /*
+     * O_DIRECT in guest should not necessarily mean bypassing page
+     * cache on host as well. If somebody needs that behavior, it
+     * probably should be a configuration knob in daemon.
+     */
+    fi->flags &= ~O_DIRECT;
+}
+
 static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
                       mode_t mode, struct fuse_file_info *fi)
 {
@@ -1721,12 +1752,7 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
         goto out;
     }
 
-    /*
-     * O_DIRECT in guest should not necessarily mean bypassing page
-     * cache on host as well. If somebody needs that behavior, it
-     * probably should be a configuration knob in daemon.
-     */
-    fi->flags &= ~O_DIRECT;
+    update_open_flags(lo->writeback, fi);
 
     fd = openat(parent_inode->fd, name, (fi->flags | O_CREAT) & ~O_NOFOLLOW,
                 mode);
@@ -1936,33 +1962,7 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
     fuse_log(FUSE_LOG_DEBUG, "lo_open(ino=%" PRIu64 ", flags=%d)\n", ino,
              fi->flags);
 
-    /*
-     * With writeback cache, kernel may send read requests even
-     * when userspace opened write-only
-     */
-    if (lo->writeback && (fi->flags & O_ACCMODE) == O_WRONLY) {
-        fi->flags &= ~O_ACCMODE;
-        fi->flags |= O_RDWR;
-    }
-
-    /*
-     * With writeback cache, O_APPEND is handled by the kernel.
-     * This breaks atomicity (since the file may change in the
-     * underlying filesystem, so that the kernel's idea of the
-     * end of the file isn't accurate anymore). In this example,
-     * we just accept that. A more rigorous filesystem may want
-     * to return an error here
-     */
-    if (lo->writeback && (fi->flags & O_APPEND)) {
-        fi->flags &= ~O_APPEND;
-    }
-
-    /*
-     * O_DIRECT in guest should not necessarily mean bypassing page
-     * cache on host as well. If somebody needs that behavior, it
-     * probably should be a configuration knob in daemon.
-     */
-    fi->flags &= ~O_DIRECT;
+    update_open_flags(lo->writeback, fi);
 
     sprintf(buf, "%i", lo_fd(req, ino));
     fd = openat(lo->proc_self_fd, buf, fi->flags & ~O_NOFOLLOW);
Signature · 1 line
2.24.1
#107 lore raw

[PULL 098/108] virtiofsd: passthrough_ll: Use cache_readdir for directory open

In reply to Dr. David Alan Gilbert (git)

From: Misono Tomohiro <[email protected]>

Since keep_cache(FOPEN_KEEP_CACHE) has no effect for directory as described in fuse_common.h, use cache_readdir(FOPNE_CACHE_DIR) for diretory open when cache=always mode.

---
 tools/virtiofsd/passthrough_ll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +1 -1
index 4c61ac5065..79b8b71a4f 100644
@@ -1523,7 +1523,7 @@ static void lo_opendir(fuse_req_t req, fuse_ino_t ino,
 
     fi->fh = fh;
     if (lo->cache == CACHE_ALWAYS) {
-        fi->keep_cache = 1;
+        fi->cache_readdir = 1;
     }
     fuse_reply_open(req, fi);
     return;
Signature · 1 line
2.24.1
#108 lore raw

[PULL 093/108] virtiofsd: introduce inode refcount to prevent use-after-free

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

If thread A is using an inode it must not be deleted by thread B when processing a FUSE_FORGET request.

The FUSE protocol itself already has a counter called nlookup that is used in FUSE_FORGET messages. We cannot trust this counter since the untrusted client can manipulate it via FUSE_FORGET messages.

Introduce a new refcount to keep inodes alive for the required lifespan. lo_inode_put() must be called to release a reference. FUSE's nlookup counter holds exactly one reference so that the inode stays alive as long as the client still wants to remember it.

Note that the lo_inode->is_symlink field is moved to avoid creating a hole in the struct due to struct field alignment.

---
 tools/virtiofsd/passthrough_ll.c | 169 ++++++++++++++++++++++++++-----
 1 file changed, 146 insertions(+), 23 deletions(-)
tools/virtiofsd/passthrough_ll.c +146 -23
index e3a6d6b611..ab1613586e 100644
@@ -97,7 +97,13 @@ struct lo_key {
 
 struct lo_inode {
     int fd;
-    bool is_symlink;
+
+    /*
+     * Atomic reference count for this object.  The nlookup field holds a
+     * reference and release it when nlookup reaches 0.
+     */
+    gint refcount;
+
     struct lo_key key;
 
     /*
@@ -116,6 +122,8 @@ struct lo_inode {
     fuse_ino_t fuse_ino;
     pthread_mutex_t plock_mutex;
     GHashTable *posix_locks; /* protected by lo_inode->plock_mutex */
+
+    bool is_symlink;
 };
 
 struct lo_cred {
@@ -471,6 +479,23 @@ static ssize_t lo_add_inode_mapping(fuse_req_t req, struct lo_inode *inode)
     return elem - lo_data(req)->ino_map.elems;
 }
 
+static void lo_inode_put(struct lo_data *lo, struct lo_inode **inodep)
+{
+    struct lo_inode *inode = *inodep;
+
+    if (!inode) {
+        return;
+    }
+
+    *inodep = NULL;
+
+    if (g_atomic_int_dec_and_test(&inode->refcount)) {
+        close(inode->fd);
+        free(inode);
+    }
+}
+
+/* Caller must release refcount using lo_inode_put() */
 static struct lo_inode *lo_inode(fuse_req_t req, fuse_ino_t ino)
 {
     struct lo_data *lo = lo_data(req);
@@ -478,6 +503,9 @@ static struct lo_inode *lo_inode(fuse_req_t req, fuse_ino_t ino)
 
     pthread_mutex_lock(&lo->mutex);
     elem = lo_map_get(&lo->ino_map, ino);
+    if (elem) {
+        g_atomic_int_inc(&elem->inode->refcount);
+    }
     pthread_mutex_unlock(&lo->mutex);
 
     if (!elem) {
@@ -487,10 +515,23 @@ static struct lo_inode *lo_inode(fuse_req_t req, fuse_ino_t ino)
     return elem->inode;
 }
 
+/*
+ * TODO Remove this helper and force callers to hold an inode refcount until
+ * they are done with the fd.  This will be done in a later patch to make
+ * review easier.
+ */
 static int lo_fd(fuse_req_t req, fuse_ino_t ino)
 {
     struct lo_inode *inode = lo_inode(req, ino);
-    return inode ? inode->fd : -1;
+    int fd;
+
+    if (!inode) {
+        return -1;
+    }
+
+    fd = inode->fd;
+    lo_inode_put(lo_data(req), &inode);
+    return fd;
 }
 
 static void lo_init(void *userdata, struct fuse_conn_info *conn)
@@ -545,6 +586,10 @@ static void lo_getattr(fuse_req_t req, fuse_ino_t ino,
     fuse_reply_attr(req, &buf, lo->timeout);
 }
 
+/*
+ * Increments parent->nlookup and caller must release refcount using
+ * lo_inode_put(&parent).
+ */
 static int lo_parent_and_name(struct lo_data *lo, struct lo_inode *inode,
                               char path[PATH_MAX], struct lo_inode **parent)
 {
@@ -582,6 +627,7 @@ retry:
         p = &lo->root;
         pthread_mutex_lock(&lo->mutex);
         p->nlookup++;
+        g_atomic_int_inc(&p->refcount);
         pthread_mutex_unlock(&lo->mutex);
     } else {
         *last = '\0';
@@ -625,6 +671,7 @@ retry:
 
 fail_unref:
     unref_inode_lolocked(lo, p, 1);
+    lo_inode_put(lo, &p);
 fail:
     if (retries) {
         retries--;
@@ -663,6 +710,7 @@ fallback:
     if (res != -1) {
         res = utimensat(parent->fd, path, tv, AT_SYMLINK_NOFOLLOW);
         unref_inode_lolocked(lo, parent, 1);
+        lo_inode_put(lo, &parent);
     }
 
     return res;
@@ -780,11 +828,13 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
             goto out_err;
         }
     }
+    lo_inode_put(lo, &inode);
 
     return lo_getattr(req, ino, fi);
 
 out_err:
     saverr = errno;
+    lo_inode_put(lo, &inode);
     fuse_reply_err(req, saverr);
 }
 
@@ -801,6 +851,7 @@ static struct lo_inode *lo_find(struct lo_data *lo, struct stat *st)
     if (p) {
         assert(p->nlookup > 0);
         p->nlookup++;
+        g_atomic_int_inc(&p->refcount);
     }
     pthread_mutex_unlock(&lo->mutex);
 
@@ -820,6 +871,10 @@ static void posix_locks_value_destroy(gpointer data)
     free(plock);
 }
 
+/*
+ * Increments nlookup and caller must release refcount using
+ * lo_inode_put(&parent).
+ */
 static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
                         struct fuse_entry_param *e)
 {
@@ -827,7 +882,8 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
     int res;
     int saverr;
     struct lo_data *lo = lo_data(req);
-    struct lo_inode *inode, *dir = lo_inode(req, parent);
+    struct lo_inode *inode = NULL;
+    struct lo_inode *dir = lo_inode(req, parent);
 
     /*
      * name_to_handle_at() and open_by_handle_at() can reach here with fuse
@@ -868,6 +924,13 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         }
 
         inode->is_symlink = S_ISLNK(e->attr.st_mode);
+
+        /*
+         * One for the caller and one for nlookup (released in
+         * unref_inode_lolocked())
+         */
+        g_atomic_int_set(&inode->refcount, 2);
+
         inode->nlookup = 1;
         inode->fd = newfd;
         newfd = -1;
@@ -883,6 +946,8 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
         pthread_mutex_unlock(&lo->mutex);
     }
     e->ino = inode->fuse_ino;
+    lo_inode_put(lo, &inode);
+    lo_inode_put(lo, &dir);
 
     fuse_log(FUSE_LOG_DEBUG, "  %lli/%s -> %lli\n", (unsigned long long)parent,
              name, (unsigned long long)e->ino);
@@ -894,6 +959,8 @@ out_err:
     if (newfd != -1) {
         close(newfd);
     }
+    lo_inode_put(lo, &inode);
+    lo_inode_put(lo, &dir);
     return saverr;
 }
 
@@ -991,6 +1058,7 @@ static void lo_mknod_symlink(fuse_req_t req, fuse_ino_t parent,
 {
     int res;
     int saverr;
+    struct lo_data *lo = lo_data(req);
     struct lo_inode *dir;
     struct fuse_entry_param e;
     struct lo_cred old = {};
@@ -1032,9 +1100,11 @@ static void lo_mknod_symlink(fuse_req_t req, fuse_ino_t parent,
              name, (unsigned long long)e.ino);
 
     fuse_reply_entry(req, &e);
+    lo_inode_put(lo, &dir);
     return;
 
 out:
+    lo_inode_put(lo, &dir);
     fuse_reply_err(req, saverr);
 }
 
@@ -1085,6 +1155,7 @@ fallback:
     if (res != -1) {
         res = linkat(parent->fd, path, dfd, name, 0);
         unref_inode_lolocked(lo, parent, 1);
+        lo_inode_put(lo, &parent);
     }
 
     return res;
@@ -1095,6 +1166,7 @@ static void lo_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t parent,
 {
     int res;
     struct lo_data *lo = lo_data(req);
+    struct lo_inode *parent_inode;
     struct lo_inode *inode;
     struct fuse_entry_param e;
     int saverr;
@@ -1104,17 +1176,18 @@ static void lo_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t parent,
         return;
     }
 
+    parent_inode = lo_inode(req, parent);
     inode = lo_inode(req, ino);
-    if (!inode) {
-        fuse_reply_err(req, EBADF);
-        return;
+    if (!parent_inode || !inode) {
+        errno = EBADF;
+        goto out_err;
     }
 
     memset(&e, 0, sizeof(struct fuse_entry_param));
     e.attr_timeout = lo->timeout;
     e.entry_timeout = lo->timeout;
 
-    res = linkat_empty_nofollow(lo, inode, lo_fd(req, parent), name);
+    res = linkat_empty_nofollow(lo, inode, parent_inode->fd, name);
     if (res == -1) {
         goto out_err;
     }
@@ -1133,13 +1206,18 @@ static void lo_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t parent,
              name, (unsigned long long)e.ino);
 
     fuse_reply_entry(req, &e);
+    lo_inode_put(lo, &parent_inode);
+    lo_inode_put(lo, &inode);
     return;
 
 out_err:
     saverr = errno;
+    lo_inode_put(lo, &parent_inode);
+    lo_inode_put(lo, &inode);
     fuse_reply_err(req, saverr);
 }
 
+/* Increments nlookup and caller must release refcount using lo_inode_put() */
 static struct lo_inode *lookup_name(fuse_req_t req, fuse_ino_t parent,
                                     const char *name)
 {
@@ -1176,6 +1254,7 @@ static void lo_rmdir(fuse_req_t req, fuse_ino_t parent, const char *name)
 
     fuse_reply_err(req, res == -1 ? errno : 0);
     unref_inode_lolocked(lo, inode, 1);
+    lo_inode_put(lo, &inode);
 }
 
 static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
@@ -1183,8 +1262,10 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
                       unsigned int flags)
 {
     int res;
-    struct lo_inode *oldinode;
-    struct lo_inode *newinode;
+    struct lo_inode *parent_inode;
+    struct lo_inode *newparent_inode;
+    struct lo_inode *oldinode = NULL;
+    struct lo_inode *newinode = NULL;
     struct lo_data *lo = lo_data(req);
 
     if (!is_safe_path_component(name) || !is_safe_path_component(newname)) {
@@ -1192,6 +1273,13 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
         return;
     }
 
+    parent_inode = lo_inode(req, parent);
+    newparent_inode = lo_inode(req, newparent);
+    if (!parent_inode || !newparent_inode) {
+        fuse_reply_err(req, EBADF);
+        goto out;
+    }
+
     oldinode = lookup_name(req, parent, name);
     newinode = lookup_name(req, newparent, newname);
 
@@ -1204,8 +1292,8 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
 #ifndef SYS_renameat2
         fuse_reply_err(req, EINVAL);
 #else
-        res = syscall(SYS_renameat2, lo_fd(req, parent), name,
-                       lo_fd(req, newparent), newname, flags);
+        res = syscall(SYS_renameat2, parent_inode->fd, name,
+                        newparent_inode->fd, newname, flags);
         if (res == -1 && errno == ENOSYS) {
             fuse_reply_err(req, EINVAL);
         } else {
@@ -1215,12 +1303,16 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
         goto out;
     }
 
-    res = renameat(lo_fd(req, parent), name, lo_fd(req, newparent), newname);
+    res = renameat(parent_inode->fd, name, newparent_inode->fd, newname);
 
     fuse_reply_err(req, res == -1 ? errno : 0);
 out:
     unref_inode_lolocked(lo, oldinode, 1);
     unref_inode_lolocked(lo, newinode, 1);
+    lo_inode_put(lo, &oldinode);
+    lo_inode_put(lo, &newinode);
+    lo_inode_put(lo, &parent_inode);
+    lo_inode_put(lo, &newparent_inode);
 }
 
 static void lo_unlink(fuse_req_t req, fuse_ino_t parent, const char *name)
@@ -1244,6 +1336,7 @@ static void lo_unlink(fuse_req_t req, fuse_ino_t parent, const char *name)
 
     fuse_reply_err(req, res == -1 ? errno : 0);
     unref_inode_lolocked(lo, inode, 1);
+    lo_inode_put(lo, &inode);
 }
 
 static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
@@ -1265,8 +1358,9 @@ static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
         g_hash_table_destroy(inode->posix_locks);
         pthread_mutex_destroy(&inode->plock_mutex);
         pthread_mutex_unlock(&lo->mutex);
-        close(inode->fd);
-        free(inode);
+
+        /* Drop our refcount from lo_do_lookup() */
+        lo_inode_put(lo, &inode);
     } else {
         pthread_mutex_unlock(&lo->mutex);
     }
@@ -1280,6 +1374,7 @@ static int unref_all_inodes_cb(gpointer key, gpointer value, gpointer user_data)
     inode->nlookup = 0;
     lo_map_remove(&lo->ino_map, inode->fuse_ino);
     close(inode->fd);
+    lo_inode_put(lo, &inode); /* Drop our refcount from lo_do_lookup() */
 
     return TRUE;
 }
@@ -1306,6 +1401,7 @@ static void lo_forget_one(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
              (unsigned long long)nlookup);
 
     unref_inode_lolocked(lo, inode, nlookup);
+    lo_inode_put(lo, &inode);
 }
 
 static void lo_forget(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
@@ -1537,6 +1633,7 @@ static void lo_do_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
     err = 0;
 error:
     lo_dirp_put(&d);
+    lo_inode_put(lo, &dinode);
 
     /*
      * If there's an error, we can only signal it if we haven't stored
@@ -1595,6 +1692,7 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
 {
     int fd;
     struct lo_data *lo = lo_data(req);
+    struct lo_inode *parent_inode;
     struct fuse_entry_param e;
     int err;
     struct lo_cred old = {};
@@ -1607,12 +1705,18 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
         return;
     }
 
+    parent_inode = lo_inode(req, parent);
+    if (!parent_inode) {
+        fuse_reply_err(req, EBADF);
+        return;
+    }
+
     err = lo_change_cred(req, &old);
     if (err) {
         goto out;
     }
 
-    fd = openat(lo_fd(req, parent), name, (fi->flags | O_CREAT) & ~O_NOFOLLOW,
+    fd = openat(parent_inode->fd, name, (fi->flags | O_CREAT) & ~O_NOFOLLOW,
                 mode);
     err = fd == -1 ? errno : 0;
     lo_restore_cred(&old);
@@ -1625,8 +1729,8 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
         pthread_mutex_unlock(&lo->mutex);
         if (fh == -1) {
             close(fd);
-            fuse_reply_err(req, ENOMEM);
-            return;
+            err = ENOMEM;
+            goto out;
         }
 
         fi->fh = fh;
@@ -1639,6 +1743,8 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
     }
 
 out:
+    lo_inode_put(lo, &parent_inode);
+
     if (err) {
         fuse_reply_err(req, err);
     } else {
@@ -1712,16 +1818,18 @@ static void lo_getlk(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi,
     plock =
         lookup_create_plock_ctx(lo, inode, fi->lock_owner, lock->l_pid, &ret);
     if (!plock) {
-        pthread_mutex_unlock(&inode->plock_mutex);
-        fuse_reply_err(req, ret);
-        return;
+        saverr = ret;
+        goto out;
     }
 
     ret = fcntl(plock->fd, F_OFD_GETLK, lock);
     if (ret == -1) {
         saverr = errno;
     }
+
+out:
     pthread_mutex_unlock(&inode->plock_mutex);
+    lo_inode_put(lo, &inode);
 
     if (saverr) {
         fuse_reply_err(req, saverr);
@@ -1761,9 +1869,8 @@ static void lo_setlk(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi,
         lookup_create_plock_ctx(lo, inode, fi->lock_owner, lock->l_pid, &ret);
 
     if (!plock) {
-        pthread_mutex_unlock(&inode->plock_mutex);
-        fuse_reply_err(req, ret);
-        return;
+        saverr = ret;
+        goto out;
     }
 
     /* TODO: Is it alright to modify flock? */
@@ -1772,7 +1879,11 @@ static void lo_setlk(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi,
     if (ret == -1) {
         saverr = errno;
     }
+
+out:
     pthread_mutex_unlock(&inode->plock_mutex);
+    lo_inode_put(lo, &inode);
+
     fuse_reply_err(req, saverr);
 }
 
@@ -1898,6 +2009,7 @@ static void lo_flush(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
     pthread_mutex_unlock(&inode->plock_mutex);
 
     res = close(dup(lo_fi_fd(req, fi)));
+    lo_inode_put(lo_data(req), &inode);
     fuse_reply_err(req, res == -1 ? errno : 0);
 }
 
@@ -2115,11 +2227,14 @@ out_free:
     if (fd >= 0) {
         close(fd);
     }
+
+    lo_inode_put(lo, &inode);
     return;
 
 out_err:
     saverr = errno;
 out:
+    lo_inode_put(lo, &inode);
     fuse_reply_err(req, saverr);
     goto out_free;
 }
@@ -2190,11 +2305,14 @@ out_free:
     if (fd >= 0) {
         close(fd);
     }
+
+    lo_inode_put(lo, &inode);
     return;
 
 out_err:
     saverr = errno;
 out:
+    lo_inode_put(lo, &inode);
     fuse_reply_err(req, saverr);
     goto out_free;
 }
@@ -2243,6 +2361,8 @@ out:
     if (fd >= 0) {
         close(fd);
     }
+
+    lo_inode_put(lo, &inode);
     fuse_reply_err(req, saverr);
 }
 
@@ -2289,6 +2409,8 @@ out:
     if (fd >= 0) {
         close(fd);
     }
+
+    lo_inode_put(lo, &inode);
     fuse_reply_err(req, saverr);
 }
 
@@ -2671,6 +2793,7 @@ static void setup_root(struct lo_data *lo, struct lo_inode *root)
     root->key.ino = stat.st_ino;
     root->key.dev = stat.st_dev;
     root->nlookup = 2;
+    g_atomic_int_set(&root->refcount, 2);
 }
 
 static guint lo_key_hash(gconstpointer key)
Signature · 1 line
2.24.1
#109 lore raw

[PULL 101/108] virtiofsd: process requests in a thread pool

In reply to Dr. David Alan Gilbert (git)

From: Stefan Hajnoczi <[email protected]>

Introduce a thread pool so that fv_queue_thread() just pops VuVirtqElements and hands them to the thread pool. For the time being only one worker thread is allowed since passthrough_ll.c is not thread-safe yet. Future patches will lift this restriction so that multiple FUSE requests can be processed in parallel.

The main new concept is struct FVRequest, which contains both VuVirtqElement and struct fuse_chan. We now have fv_VuDev for a device, fv_QueueInfo for a virtqueue, and FVRequest for a request. Some of fv_QueueInfo's fields are moved into FVRequest because they are per-request. The name FVRequest conforms to QEMU coding style and I expect the struct fv_* types will be renamed in a future refactoring.

This patch series is not optimal. fbuf reuse is dropped so each request does malloc(se->bufsize), but there is no clean and cheap way to keep this with a thread pool. The vq_lock mutex is held for longer than necessary, especially during the eventfd_write() syscall. Performance can be improved in the future.

prctl(2) had to be added to the seccomp whitelist because glib invokes it.

---
 tools/virtiofsd/fuse_virtio.c | 359 +++++++++++++++++++---------------
 1 file changed, 201 insertions(+), 158 deletions(-)
tools/virtiofsd/fuse_virtio.c +201 -158
index f6242f9338..0dcf2ef57a 100644
@@ -22,6 +22,7 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <glib.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -37,17 +38,28 @@
 struct fv_VuDev;
 struct fv_QueueInfo {
     pthread_t thread;
+    /*
+     * This lock protects the VuVirtq preventing races between
+     * fv_queue_thread() and fv_queue_worker().
+     */
+    pthread_mutex_t vq_lock;
+
     struct fv_VuDev *virtio_dev;
 
     /* Our queue index, corresponds to array position */
     int qidx;
     int kick_fd;
     int kill_fd; /* For killing the thread */
+};
 
-    /* The element for the command currently being processed */
-    VuVirtqElement *qe;
+/* A FUSE request */
+typedef struct {
+    VuVirtqElement elem;
+    struct fuse_chan ch;
+
+    /* Used to complete requests that involve no reply */
     bool reply_sent;
-};
+} FVRequest;
 
 /*
  * We pass the dev element into libvhost-user
@@ -191,8 +203,11 @@ static void copy_iov(struct iovec *src_iov, int src_count,
 int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
                     struct iovec *iov, int count)
 {
-    VuVirtqElement *elem;
-    VuVirtq *q;
+    FVRequest *req = container_of(ch, FVRequest, ch);
+    struct fv_QueueInfo *qi = ch->qi;
+    VuDev *dev = &se->virtio_dev->dev;
+    VuVirtq *q = vu_get_queue(dev, qi->qidx);
+    VuVirtqElement *elem = &req->elem;
     int ret = 0;
 
     assert(count >= 1);
@@ -205,11 +220,7 @@ int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
 
     /* unique == 0 is notification, which we don't support */
     assert(out->unique);
-    /* For virtio we always have ch */
-    assert(ch);
-    assert(!ch->qi->reply_sent);
-    elem = ch->qi->qe;
-    q = &ch->qi->virtio_dev->dev.vq[ch->qi->qidx];
+    assert(!req->reply_sent);
 
     /* The 'in' part of the elem is to qemu */
     unsigned int in_num = elem->in_num;
@@ -236,9 +247,15 @@ int virtio_send_msg(struct fuse_session *se, struct fuse_chan *ch,
     }
 
     copy_iov(iov, count, in_sg, in_num, tosend_len);
-    vu_queue_push(&se->virtio_dev->dev, q, elem, tosend_len);
-    vu_queue_notify(&se->virtio_dev->dev, q);
-    ch->qi->reply_sent = true;
+
+    pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock);
+    pthread_mutex_lock(&qi->vq_lock);
+    vu_queue_push(dev, q, elem, tosend_len);
+    vu_queue_notify(dev, q);
+    pthread_mutex_unlock(&qi->vq_lock);
+    pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock);
+
+    req->reply_sent = true;
 
 err:
     return ret;
@@ -254,9 +271,12 @@ int virtio_send_data_iov(struct fuse_session *se, struct fuse_chan *ch,
                          struct iovec *iov, int count, struct fuse_bufvec *buf,
                          size_t len)
 {
+    FVRequest *req = container_of(ch, FVRequest, ch);
+    struct fv_QueueInfo *qi = ch->qi;
+    VuDev *dev = &se->virtio_dev->dev;
+    VuVirtq *q = vu_get_queue(dev, qi->qidx);
+    VuVirtqElement *elem = &req->elem;
     int ret = 0;
-    VuVirtqElement *elem;
-    VuVirtq *q;
 
     assert(count >= 1);
     assert(iov[0].iov_len >= sizeof(struct fuse_out_header));
@@ -275,11 +295,7 @@ int virtio_send_data_iov(struct fuse_session *se, struct fuse_chan *ch,
     /* unique == 0 is notification which we don't support */
     assert(out->unique);
 
-    /* For virtio we always have ch */
-    assert(ch);
-    assert(!ch->qi->reply_sent);
-    elem = ch->qi->qe;
-    q = &ch->qi->virtio_dev->dev.vq[ch->qi->qidx];
+    assert(!req->reply_sent);
 
     /* The 'in' part of the elem is to qemu */
     unsigned int in_num = elem->in_num;
@@ -395,33 +411,175 @@ int virtio_send_data_iov(struct fuse_session *se, struct fuse_chan *ch,
 
     ret = 0;
 
-    vu_queue_push(&se->virtio_dev->dev, q, elem, tosend_len);
-    vu_queue_notify(&se->virtio_dev->dev, q);
+    pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock);
+    pthread_mutex_lock(&qi->vq_lock);
+    vu_queue_push(dev, q, elem, tosend_len);
+    vu_queue_notify(dev, q);
+    pthread_mutex_unlock(&qi->vq_lock);
+    pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock);
 
 err:
     if (ret == 0) {
-        ch->qi->reply_sent = true;
+        req->reply_sent = true;
     }
 
     return ret;
 }
 
+/* Process one FVRequest in a thread pool */
+static void fv_queue_worker(gpointer data, gpointer user_data)
+{
+    struct fv_QueueInfo *qi = user_data;
+    struct fuse_session *se = qi->virtio_dev->se;
+    struct VuDev *dev = &qi->virtio_dev->dev;
+    FVRequest *req = data;
+    VuVirtqElement *elem = &req->elem;
+    struct fuse_buf fbuf = {};
+    bool allocated_bufv = false;
+    struct fuse_bufvec bufv;
+    struct fuse_bufvec *pbufv;
+
+    assert(se->bufsize > sizeof(struct fuse_in_header));
+
+    /*
+     * An element contains one request and the space to send our response
+     * They're spread over multiple descriptors in a scatter/gather set
+     * and we can't trust the guest to keep them still; so copy in/out.
+     */
+    fbuf.mem = malloc(se->bufsize);
+    assert(fbuf.mem);
+
+    fuse_mutex_init(&req->ch.lock);
+    req->ch.fd = -1;
+    req->ch.qi = qi;
+
+    /* The 'out' part of the elem is from qemu */
+    unsigned int out_num = elem->out_num;
+    struct iovec *out_sg = elem->out_sg;
+    size_t out_len = iov_size(out_sg, out_num);
+    fuse_log(FUSE_LOG_DEBUG,
+             "%s: elem %d: with %d out desc of length %zd\n",
+             __func__, elem->index, out_num, out_len);
+
+    /*
+     * The elem should contain a 'fuse_in_header' (in to fuse)
+     * plus the data based on the len in the header.
+     */
+    if (out_len < sizeof(struct fuse_in_header)) {
+        fuse_log(FUSE_LOG_ERR, "%s: elem %d too short for in_header\n",
+                 __func__, elem->index);
+        assert(0); /* TODO */
+    }
+    if (out_len > se->bufsize) {
+        fuse_log(FUSE_LOG_ERR, "%s: elem %d too large for buffer\n", __func__,
+                 elem->index);
+        assert(0); /* TODO */
+    }
+    /* Copy just the first element and look at it */
+    copy_from_iov(&fbuf, 1, out_sg);
+
+    pbufv = NULL; /* Compiler thinks an unitialised path */
+    if (out_num > 2 &&
+        out_sg[0].iov_len == sizeof(struct fuse_in_header) &&
+        ((struct fuse_in_header *)fbuf.mem)->opcode == FUSE_WRITE &&
+        out_sg[1].iov_len == sizeof(struct fuse_write_in)) {
+        /*
+         * For a write we don't actually need to copy the
+         * data, we can just do it straight out of guest memory
+         * but we must still copy the headers in case the guest
+         * was nasty and changed them while we were using them.
+         */
+        fuse_log(FUSE_LOG_DEBUG, "%s: Write special case\n", __func__);
+
+        /* copy the fuse_write_in header afte rthe fuse_in_header */
+        fbuf.mem += out_sg->iov_len;
+        copy_from_iov(&fbuf, 1, out_sg + 1);
+        fbuf.mem -= out_sg->iov_len;
+        fbuf.size = out_sg[0].iov_len + out_sg[1].iov_len;
+
+        /* Allocate the bufv, with space for the rest of the iov */
+        pbufv = malloc(sizeof(struct fuse_bufvec) +
+                       sizeof(struct fuse_buf) * (out_num - 2));
+        if (!pbufv) {
+            fuse_log(FUSE_LOG_ERR, "%s: pbufv malloc failed\n",
+                    __func__);
+            goto out;
+        }
+
+        allocated_bufv = true;
+        pbufv->count = 1;
+        pbufv->buf[0] = fbuf;
+
+        size_t iovindex, pbufvindex;
+        iovindex = 2; /* 2 headers, separate iovs */
+        pbufvindex = 1; /* 2 headers, 1 fusebuf */
+
+        for (; iovindex < out_num; iovindex++, pbufvindex++) {
+            pbufv->count++;
+            pbufv->buf[pbufvindex].pos = ~0; /* Dummy */
+            pbufv->buf[pbufvindex].flags = 0;
+            pbufv->buf[pbufvindex].mem = out_sg[iovindex].iov_base;
+            pbufv->buf[pbufvindex].size = out_sg[iovindex].iov_len;
+        }
+    } else {
+        /* Normal (non fast write) path */
+
+        /* Copy the rest of the buffer */
+        fbuf.mem += out_sg->iov_len;
+        copy_from_iov(&fbuf, out_num - 1, out_sg + 1);
+        fbuf.mem -= out_sg->iov_len;
+        fbuf.size = out_len;
+
+        /* TODO! Endianness of header */
+
+        /* TODO: Add checks for fuse_session_exited */
+        bufv.buf[0] = fbuf;
+        bufv.count = 1;
+        pbufv = &bufv;
+    }
+    pbufv->idx = 0;
+    pbufv->off = 0;
+    fuse_session_process_buf_int(se, pbufv, &req->ch);
+
+out:
+    if (allocated_bufv) {
+        free(pbufv);
+    }
+
+    /* If the request has no reply, still recycle the virtqueue element */
+    if (!req->reply_sent) {
+        struct VuVirtq *q = vu_get_queue(dev, qi->qidx);
+
+        fuse_log(FUSE_LOG_DEBUG, "%s: elem %d no reply sent\n", __func__,
+                 elem->index);
+
+        pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock);
+        pthread_mutex_lock(&qi->vq_lock);
+        vu_queue_push(dev, q, elem, 0);
+        vu_queue_notify(dev, q);
+        pthread_mutex_unlock(&qi->vq_lock);
+        pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock);
+    }
+
+    pthread_mutex_destroy(&req->ch.lock);
+    free(fbuf.mem);
+    free(req);
+}
+
 /* Thread function for individual queues, created when a queue is 'started' */
 static void *fv_queue_thread(void *opaque)
 {
     struct fv_QueueInfo *qi = opaque;
     struct VuDev *dev = &qi->virtio_dev->dev;
     struct VuVirtq *q = vu_get_queue(dev, qi->qidx);
-    struct fuse_session *se = qi->virtio_dev->se;
-    struct fuse_chan ch;
-    struct fuse_buf fbuf;
+    GThreadPool *pool;
 
-    fbuf.mem = NULL;
-    fbuf.flags = 0;
-
-    fuse_mutex_init(&ch.lock);
-    ch.fd = (int)0xdaff0d111;
-    ch.qi = qi;
+    pool = g_thread_pool_new(fv_queue_worker, qi, 1 /* TODO max_threads */,
+                             TRUE, NULL);
+    if (!pool) {
+        fuse_log(FUSE_LOG_ERR, "%s: g_thread_pool_new failed\n", __func__);
+        return NULL;
+    }
 
     fuse_log(FUSE_LOG_INFO, "%s: Start for queue %d kick_fd %d\n", __func__,
              qi->qidx, qi->kick_fd);
@@ -478,6 +636,7 @@ static void *fv_queue_thread(void *opaque)
         /* Mutual exclusion with virtio_loop() */
         ret = pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock);
         assert(ret == 0); /* there is no possible error case */
+        pthread_mutex_lock(&qi->vq_lock);
         /* out is from guest, in is too guest */
         unsigned int in_bytes, out_bytes;
         vu_queue_get_avail_bytes(dev, q, &in_bytes, &out_bytes, ~0, ~0);
@@ -486,141 +645,22 @@ static void *fv_queue_thread(void *opaque)
                  "%s: Queue %d gave evalue: %zx available: in: %u out: %u\n",
                  __func__, qi->qidx, (size_t)evalue, in_bytes, out_bytes);
 
-
         while (1) {
-            bool allocated_bufv = false;
-            struct fuse_bufvec bufv;
-            struct fuse_bufvec *pbufv;
-
-            /*
-             * An element contains one request and the space to send our
-             * response They're spread over multiple descriptors in a
-             * scatter/gather set and we can't trust the guest to keep them
-             * still; so copy in/out.
-             */
-            VuVirtqElement *elem = vu_queue_pop(dev, q, sizeof(VuVirtqElement));
-            if (!elem) {
+            FVRequest *req = vu_queue_pop(dev, q, sizeof(FVRequest));
+            if (!req) {
                 break;
             }
 
-            qi->qe = elem;
-            qi->reply_sent = false;
+            req->reply_sent = false;
 
-            if (!fbuf.mem) {
-                fbuf.mem = malloc(se->bufsize);
-                assert(fbuf.mem);
-                assert(se->bufsize > sizeof(struct fuse_in_header));
-            }
-            /* The 'out' part of the elem is from qemu */
-            unsigned int out_num = elem->out_num;
-            struct iovec *out_sg = elem->out_sg;
-            size_t out_len = iov_size(out_sg, out_num);
-            fuse_log(FUSE_LOG_DEBUG,
-                     "%s: elem %d: with %d out desc of length %zd\n", __func__,
-                     elem->index, out_num, out_len);
-
-            /*
-             * The elem should contain a 'fuse_in_header' (in to fuse)
-             * plus the data based on the len in the header.
-             */
-            if (out_len < sizeof(struct fuse_in_header)) {
-                fuse_log(FUSE_LOG_ERR, "%s: elem %d too short for in_header\n",
-                         __func__, elem->index);
-                assert(0); /* TODO */
-            }
-            if (out_len > se->bufsize) {
-                fuse_log(FUSE_LOG_ERR, "%s: elem %d too large for buffer\n",
-                         __func__, elem->index);
-                assert(0); /* TODO */
-            }
-            /* Copy just the first element and look at it */
-            copy_from_iov(&fbuf, 1, out_sg);
-
-            if (out_num > 2 &&
-                out_sg[0].iov_len == sizeof(struct fuse_in_header) &&
-                ((struct fuse_in_header *)fbuf.mem)->opcode == FUSE_WRITE &&
-                out_sg[1].iov_len == sizeof(struct fuse_write_in)) {
-                /*
-                 * For a write we don't actually need to copy the
-                 * data, we can just do it straight out of guest memory
-                 * but we must still copy the headers in case the guest
-                 * was nasty and changed them while we were using them.
-                 */
-                fuse_log(FUSE_LOG_DEBUG, "%s: Write special case\n", __func__);
-
-                /* copy the fuse_write_in header after the fuse_in_header */
-                fbuf.mem += out_sg->iov_len;
-                copy_from_iov(&fbuf, 1, out_sg + 1);
-                fbuf.mem -= out_sg->iov_len;
-                fbuf.size = out_sg[0].iov_len + out_sg[1].iov_len;
-
-                /* Allocate the bufv, with space for the rest of the iov */
-                allocated_bufv = true;
-                pbufv = malloc(sizeof(struct fuse_bufvec) +
-                               sizeof(struct fuse_buf) * (out_num - 2));
-                if (!pbufv) {
-                    vu_queue_unpop(dev, q, elem, 0);
-                    free(elem);
-                    fuse_log(FUSE_LOG_ERR, "%s: pbufv malloc failed\n",
-                             __func__);
-                    goto out;
-                }
-
-                pbufv->count = 1;
-                pbufv->buf[0] = fbuf;
-
-                size_t iovindex, pbufvindex;
-                iovindex = 2; /* 2 headers, separate iovs */
-                pbufvindex = 1; /* 2 headers, 1 fusebuf */
-
-                for (; iovindex < out_num; iovindex++, pbufvindex++) {
-                    pbufv->count++;
-                    pbufv->buf[pbufvindex].pos = ~0; /* Dummy */
-                    pbufv->buf[pbufvindex].flags = 0;
-                    pbufv->buf[pbufvindex].mem = out_sg[iovindex].iov_base;
-                    pbufv->buf[pbufvindex].size = out_sg[iovindex].iov_len;
-                }
-            } else {
-                /* Normal (non fast write) path */
-
-                /* Copy the rest of the buffer */
-                fbuf.mem += out_sg->iov_len;
-                copy_from_iov(&fbuf, out_num - 1, out_sg + 1);
-                fbuf.mem -= out_sg->iov_len;
-                fbuf.size = out_len;
-
-                /* TODO! Endianness of header */
-
-                /* TODO: Add checks for fuse_session_exited */
-                bufv.buf[0] = fbuf;
-                bufv.count = 1;
-                pbufv = &bufv;
-            }
-            pbufv->idx = 0;
-            pbufv->off = 0;
-            fuse_session_process_buf_int(se, pbufv, &ch);
-
-            if (allocated_bufv) {
-                free(pbufv);
-            }
-
-            if (!qi->reply_sent) {
-                fuse_log(FUSE_LOG_DEBUG, "%s: elem %d no reply sent\n",
-                         __func__, elem->index);
-                /* I think we've still got to recycle the element */
-                vu_queue_push(dev, q, elem, 0);
-                vu_queue_notify(dev, q);
-            }
-            qi->qe = NULL;
-            free(elem);
-            elem = NULL;
+            g_thread_pool_push(pool, req, NULL);
         }
 
+        pthread_mutex_unlock(&qi->vq_lock);
         pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock);
     }
-out:
-    pthread_mutex_destroy(&ch.lock);
-    free(fbuf.mem);
+
+    g_thread_pool_free(pool, FALSE, TRUE);
 
     return NULL;
 }
@@ -643,6 +683,7 @@ static void fv_queue_cleanup_thread(struct fv_VuDev *vud, int qidx)
         fuse_log(FUSE_LOG_ERR, "%s: Failed to join thread idx %d err %d\n",
                  __func__, qidx, ret);
     }
+    pthread_mutex_destroy(&ourqi->vq_lock);
     close(ourqi->kill_fd);
     ourqi->kick_fd = -1;
     free(vud->qi[qidx]);
@@ -696,6 +737,8 @@ static void fv_queue_set_started(VuDev *dev, int qidx, bool started)
 
         ourqi->kill_fd = eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE);
         assert(ourqi->kill_fd != -1);
+        pthread_mutex_init(&ourqi->vq_lock, NULL);
+
         if (pthread_create(&ourqi->thread, NULL, fv_queue_thread, ourqi)) {
             fuse_log(FUSE_LOG_ERR, "%s: Failed to create thread for queue %d\n",
                      __func__, qidx);
Signature · 1 line
2.24.1
#110 lore raw

[PULL 106/108] virtiofsd/passthrough_ll: Pass errno to fuse_reply_err()

In reply to Dr. David Alan Gilbert (git)

From: Xiao Yang <[email protected]>

lo_copy_file_range() passes -errno to fuse_reply_err() and then fuse_reply_err() changes it to errno again, so that subsequent fuse_send_reply_iov_nofree() catches the wrong errno.(i.e. reports "fuse: bad error value: ...").

Make fuse_send_reply_iov_nofree() accept the correct -errno by passing errno directly in lo_copy_file_range().

dgilbert: Sent upstream and now Merged as aa1185e153f774f1df65

---
 tools/virtiofsd/passthrough_ll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +1 -1
index fc15d61510..e6f2399efc 100644
@@ -2441,7 +2441,7 @@ static void lo_copy_file_range(fuse_req_t req, fuse_ino_t ino_in, off_t off_in,
 
     res = copy_file_range(in_fd, &off_in, out_fd, &off_out, len, flags);
     if (res < 0) {
-        fuse_reply_err(req, -errno);
+        fuse_reply_err(req, errno);
     } else {
         fuse_reply_write(req, res);
     }
Signature · 1 line
2.24.1
#111 lore raw

[PULL 107/108] virtiofsd: stop all queue threads on exit in virtio_loop()

In reply to Dr. David Alan Gilbert (git)

From: Eryu Guan <[email protected]>

On guest graceful shutdown, virtiofsd receives VHOST_USER_GET_VRING_BASE request from VMM and shuts down virtqueues by calling fv_set_started(), which joins fv_queue_thread() threads. So when virtio_loop() returns, there should be no thread is still accessing data in fuse session and/or virtio dev.

But on abnormal exit, e.g. guest got killed for whatever reason, vhost-user socket is closed and virtio_loop() breaks out the main loop and returns to main(). But it's possible fv_queue_worker()s are still working and accessing fuse session and virtio dev, which results in crash or use-after-free.

Fix it by stopping fv_queue_thread()s before virtio_loop() returns, to make sure there's no-one could access fuse session and virtio dev.

---
 tools/virtiofsd/fuse_virtio.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
tools/virtiofsd/fuse_virtio.c +13 -0
index 9f6582343c..80a6e929df 100644
@@ -815,6 +815,19 @@ int virtio_loop(struct fuse_session *se)
         }
     }
 
+    /*
+     * Make sure all fv_queue_thread()s quit on exit, as we're about to
+     * free virtio dev and fuse session, no one should access them anymore.
+     */
+    for (int i = 0; i < se->virtio_dev->nqueues; i++) {
+        if (!se->virtio_dev->qi[i]) {
+            continue;
+        }
+
+        fuse_log(FUSE_LOG_INFO, "%s: Stopping queue %d thread\n", __func__, i);
+        fv_queue_cleanup_thread(se->virtio_dev, i);
+    }
+
     fuse_log(FUSE_LOG_INFO, "%s: Exit\n", __func__);
 
     return 0;
Signature · 1 line
2.24.1
#112 lore raw
In reply to Dr. David Alan Gilbert (git)
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [PULL 000/108] virtiofs queue

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
02e4c6d virtiofsd: add some options to the help message
91b9210 virtiofsd: stop all queue threads on exit in virtio_loop() 9325310 virtiofsd/passthrough_ll: Pass errno to fuse_reply_err()
698292e virtiofsd: Convert lo_destroy to take the lo->mutex lock itself 72ece8f virtiofsd: add --thread-pool-size=NUM option
87504eb virtiofsd: fix lo_destroy() resource leaks
b573bdd virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races
322bbdc virtiofsd: process requests in a thread pool
0e583a1 virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance 4fda6a6 virtiofsd: add definition of fuse_buf_writev()
1f67fb7 virtiofsd: passthrough_ll: Use cache_readdir for directory open 9e739a1 virtiofsd: Fix data corruption with O_APPEND write in writeback mode e5ee594 virtiofsd: Reset O_DIRECT flag during file open
269002e virtiofsd: convert more fprintf and perror to use fuse log infra 649aa49 virtiofsd: do not always set FUSE_FLOCK_LOCKS
a769832 virtiofsd: introduce inode refcount to prevent use-after-free c70b7ee virtiofsd: passthrough_ll: fix refcounting on remove/rename 604298d libvhost-user: Fix some memtable remap cases
2ad1f55 virtiofsd: rename inode->refcount to inode->nlookup
f00cb4e virtiofsd: prevent races with lo_dirp_put()
b6ff58c virtiofsd: make lo_release() atomic
c1c535a virtiofsd: prevent fv_queue_thread() vs virtio_loop() races aead534 virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy() b76abf5 virtiofsd: Support remote posix locks
6902eb8 Virtiofsd: fix memory leak on fuse queueinfo
be5097a virtiofsd: fix incorrect error handling in lo_do_lookup
9006657 virtiofsd: enable PARALLEL_DIROPS during INIT
4706f46 virtiofsd: Prevent multiply running with same vhost_user_socket f211a36 virtiofsd: add helper for lo_data cleanup
38200c6 virtiofsd: fix memory leak on lo.source
7f99afc virtiofsd: cleanup allocated resource in se
a1522ea virtiofsd: fix error handling in main()
f0e3fbc virtiofsd: support nanosecond resolution for file timestamp 0220aed virtiofsd: Clean up inodes on destroy
7a380f3 virtiofsd: passthrough_ll: use hashtable
1e21a9c virtiofsd: passthrough_ll: clean up cache related options
1b05316 virtiofsd: extract root inode init into setup_root()
1c063c8 virtiofsd: fail when parent inode isn't known in lo_do_lookup() 7ddb8e2 virtiofsd: rename unref_inode() to unref_inode_lolocked()
4dd6c3a virtiofsd: passthrough_ll: control readdirplus
b9097c9 virtiofsd: passthrough_ll: disable readdirplus on cache=never c0279a6 virtiofsd: passthrough_ll: add renameat2 support
824a1db contrib/libvhost-user: Protect slave fd with mutex
851e8ec vhost-user: Print unexpected slave message types
818e2fc virtiofsd: Kill threads when queues are stopped
f04fe35 virtiofsd: Handle hard reboot
4002eb6 virtiofsd: Handle reinit
c257992 virtiofsd: Add timestamp to the log with FUSE_LOG_DEBUG level fb926ee virtiofsd: Add ID to the log with FUSE_LOG_DEBUG level
776503c virtiofsd: print log only when priority is high enough
d19e062 virtiofsd: add --syslog command-line option
788d319 virtiofsd: fix libfuse information leaks
8b61e80 virtiofsd: set maximum RLIMIT_NOFILE limit
e137992 virtiofsd: Drop CAP_FSETID if client asked for it
9cc34cc virtiofsd: cap-ng helpers
7a02936 virtiofsd: Parse flag FUSE_WRITE_KILL_PRIV
95d60ee virtiofsd: add seccomp whitelist
eb214a7 virtiofsd: move to a new pid namespace
3228cd4 virtiofsd: move to an empty network namespace
f20606a virtiofsd: sandbox mount namespace
b8b6552 virtiofsd: use /proc/self/fd/ O_PATH file descriptor
c3f5b07 virtiofsd: prevent ".." escape in lo_do_readdir()
3cb4463 virtiofsd: prevent ".." escape in lo_do_lookup()
3d11f12 virtiofsd: check input buffer size in fuse_lowlevel.c ops
38b34ea virtiofsd: validate input buffer sizes in do_write_buf()
9c34b09 virtiofsd: add fuse_mbuf_iter API
6b7914f virtiofsd: Pass write iov's all the way through
78d7979 virtiofsd: Plumb fuse_bufvec through to do_write_buf
408f8a1 virtiofsd: validate path components
bca92ad virtiofsd: passthrough_ll: add fallback for racy ops
3ed5357 virtiofsd: passthrough_ll: add fd_map to hide file descriptors fad5ec7 virtiofsd: passthrough_ll: add dirp_map to hide lo_dirp pointers db71a83 virtiofsd: passthrough_ll: add ino_map to hide lo_inode pointers 5a8812e virtiofsd: passthrough_ll: add lo_map for ino/fh indirection d66da85 virtiofsd: passthrough_ll: create new files in caller's context cffa2ea virtiofs: Add maintainers entry
c317252 virtiofsd: add --print-capabilities option
f437f8d virtiofsd: add vhost-user.json file
bd6c9f4 virtiofsd: make -f (foreground) the default
312e7d4 virtiofsd: add --fd=FDNUM fd passing option
52a2eec virtiofsd: Fast path for virtio read
ca3b0f6 virtiofsd: Add Makefile wiring for virtiofsd contrib
9e7093d virtiofsd: Keep track of replies
5bece7b virtiofsd: Send replies to messages
1372ebd virtiofsd: Start reading commands from queue
36e6c52 virtiofsd: Poll kick_fd for queue
440938d virtiofsd: Start queue threads
ad8b170 virtiofsd: get/set features callbacks
287b48c virtiofsd: Add main virtio loop
fef307e virtiofsd: Start wiring up vhost-user
0839049 virtiofsd: Open vhost connection instead of mounting
87cb3ca virtiofsd: add -o source=PATH to help output
a6f8a68 virtiofsd: Add options for virtio
01b4a15 virtiofsd: Make fsync work even if only inode is passed in 674d18b vitriofsd/passthrough_ll: fix fallocate() ifdefs
afdaf8e virtiofsd: Trim out compatibility code
85d350a virtiofsd: Fix common header and define for QEMU builds
470bf03 virtiofsd: Fix fuse_daemonize ignored return values
988582c virtiofsd: Remove unused enum fuse_buf_copy_flags
e0ade3b virtiofsd: remove unused notify reply support
40408f0 virtiofsd: remove mountpoint dummy argument
c695a07 virtiofsd: Format imported files to qemu style
4de66b5 virtiofsd: Trim down imported files
b0e9634 virtiofsd: Add passthrough_ll
dcd7ad1 virtiofsd: Add fuse_lowlevel.c
40b6782 virtiofsd: Add auxiliary .c's
63a5daf virtiofsd: Pull in kernel's fuse.h
ed88b1c virtiofsd: Pull in upstream headers

=== OUTPUT BEGIN ===
1/108 Checking commit ed88b1c5bf93 (virtiofsd: Pull in upstream headers)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16:
new file mode 100644

WARNING: Block comments use * on subsequent lines
#22: FILE: tools/virtiofsd/fuse.h:2:
+/*
+ FUSE: Filesystem in Userspace

WARNING: Block comments use a leading /* on a separate line #32: FILE: tools/virtiofsd/fuse.h:12:
+/** @file

WARNING: architecture specific defines should be avoided #48: FILE: tools/virtiofsd/fuse.h:28:
+#ifdef __cplusplus

WARNING: Block comments use a leading /* on a separate line #52: FILE: tools/virtiofsd/fuse.h:32:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#53: FILE: tools/virtiofsd/fuse.h:33:
+ * Basic FUSE API^I^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #54: FILE: tools/virtiofsd/fuse.h:34:
+ * ----------------------------------------------------------- */

ERROR: code indent should never use tabs
#63: FILE: tools/virtiofsd/fuse.h:43:
+^I/**$

ERROR: code indent should never use tabs
#64: FILE: tools/virtiofsd/fuse.h:44:
+^I * "Plus" mode.$

ERROR: code indent should never use tabs
#65: FILE: tools/virtiofsd/fuse.h:45:
+^I *$

ERROR: code indent should never use tabs
#66: FILE: tools/virtiofsd/fuse.h:46:
+^I * The kernel wants to prefill the inode cache during readdir. The$

ERROR: code indent should never use tabs
#67: FILE: tools/virtiofsd/fuse.h:47:
+^I * filesystem may honour this by filling in the attributes and setting$

ERROR: code indent should never use tabs
#68: FILE: tools/virtiofsd/fuse.h:48:
+^I * FUSE_FILL_DIR_FLAGS for the filler function. The filesystem may also$

ERROR: code indent should never use tabs
#69: FILE: tools/virtiofsd/fuse.h:49:
+^I * just ignore this flag completely.$

ERROR: code indent should never use tabs
#70: FILE: tools/virtiofsd/fuse.h:50:
+^I */$

ERROR: code indent should never use tabs
#71: FILE: tools/virtiofsd/fuse.h:51:
+^IFUSE_READDIR_PLUS = (1 << 0),$

ERROR: code indent should never use tabs
#75: FILE: tools/virtiofsd/fuse.h:55:
+^I/**$

ERROR: code indent should never use tabs
#76: FILE: tools/virtiofsd/fuse.h:56:
+^I * "Plus" mode: all file attributes are valid$

ERROR: code indent should never use tabs
#77: FILE: tools/virtiofsd/fuse.h:57:
+^I *$

ERROR: code indent should never use tabs
#78: FILE: tools/virtiofsd/fuse.h:58:
+^I * The attributes are used by the kernel to prefill the inode cache$

ERROR: code indent should never use tabs
#79: FILE: tools/virtiofsd/fuse.h:59:
+^I * during a readdir.$

ERROR: code indent should never use tabs
#80: FILE: tools/virtiofsd/fuse.h:60:
+^I *$

ERROR: code indent should never use tabs
#81: FILE: tools/virtiofsd/fuse.h:61:
+^I * It is okay to set FUSE_FILL_DIR_PLUS if FUSE_READDIR_PLUS is not set$

ERROR: code indent should never use tabs
#82: FILE: tools/virtiofsd/fuse.h:62:
+^I * and vice versa.$

ERROR: code indent should never use tabs
#83: FILE: tools/virtiofsd/fuse.h:63:
+^I */$

ERROR: code indent should never use tabs
#84: FILE: tools/virtiofsd/fuse.h:64:
+^IFUSE_FILL_DIR_PLUS = (1 << 1),$

WARNING: Block comments use a leading /* on a separate line #87: FILE: tools/virtiofsd/fuse.h:67:
+/** Function to add an entry in a readdir() operation

ERROR: trailing whitespace
#94: FILE: tools/virtiofsd/fuse.h:74:
+ * $

ERROR: code indent should never use tabs
#103: FILE: tools/virtiofsd/fuse.h:83:
+^I^I^I^Iconst struct stat *stbuf, off_t off,$

ERROR: code indent should never use tabs
#104: FILE: tools/virtiofsd/fuse.h:84:
+^I^I^I^Ienum fuse_fill_dir_flags flags);$

ERROR: code indent should never use tabs
#114: FILE: tools/virtiofsd/fuse.h:94:
+^I/**$

ERROR: code indent should never use tabs
#115: FILE: tools/virtiofsd/fuse.h:95:
+^I * If set_gid is non-zero, the st_gid attribute of each file$

ERROR: code indent should never use tabs
#116: FILE: tools/virtiofsd/fuse.h:96:
+^I * is overwritten with the value of gid.$

ERROR: code indent should never use tabs
#117: FILE: tools/virtiofsd/fuse.h:97:
+^I */$

ERROR: code indent should never use tabs
#118: FILE: tools/virtiofsd/fuse.h:98:
+^Iint set_gid;$

ERROR: code indent should never use tabs
#119: FILE: tools/virtiofsd/fuse.h:99:
+^Iunsigned int gid;$

ERROR: code indent should never use tabs
#121: FILE: tools/virtiofsd/fuse.h:101:
+^I/**$

ERROR: code indent should never use tabs
#122: FILE: tools/virtiofsd/fuse.h:102:
+^I * If set_uid is non-zero, the st_uid attribute of each file$

ERROR: code indent should never use tabs
#123: FILE: tools/virtiofsd/fuse.h:103:
+^I * is overwritten with the value of uid.$

ERROR: code indent should never use tabs
#124: FILE: tools/virtiofsd/fuse.h:104:
+^I */$

ERROR: code indent should never use tabs
#125: FILE: tools/virtiofsd/fuse.h:105:
+^Iint set_uid;$

ERROR: code indent should never use tabs
#126: FILE: tools/virtiofsd/fuse.h:106:
+^Iunsigned int uid;$

ERROR: code indent should never use tabs
#128: FILE: tools/virtiofsd/fuse.h:108:
+^I/**$

ERROR: code indent should never use tabs
#129: FILE: tools/virtiofsd/fuse.h:109:
+^I * If set_mode is non-zero, the any permissions bits set in$

ERROR: code indent should never use tabs
#130: FILE: tools/virtiofsd/fuse.h:110:
+^I * umask are unset in the st_mode attribute of each file.$

ERROR: code indent should never use tabs
#131: FILE: tools/virtiofsd/fuse.h:111:
+^I */$

ERROR: code indent should never use tabs
#132: FILE: tools/virtiofsd/fuse.h:112:
+^Iint set_mode;$

ERROR: code indent should never use tabs
#133: FILE: tools/virtiofsd/fuse.h:113:
+^Iunsigned int umask;$

ERROR: code indent should never use tabs
#135: FILE: tools/virtiofsd/fuse.h:115:
+^I/**$

ERROR: code indent should never use tabs
#136: FILE: tools/virtiofsd/fuse.h:116:
+^I * The timeout in seconds for which name lookups will be$

ERROR: code indent should never use tabs
#137: FILE: tools/virtiofsd/fuse.h:117:
+^I * cached.$

ERROR: code indent should never use tabs
#138: FILE: tools/virtiofsd/fuse.h:118:
+^I */$

ERROR: code indent should never use tabs
#139: FILE: tools/virtiofsd/fuse.h:119:
+^Idouble entry_timeout;$

ERROR: code indent should never use tabs
#141: FILE: tools/virtiofsd/fuse.h:121:
+^I/**$

ERROR: code indent should never use tabs
#142: FILE: tools/virtiofsd/fuse.h:122:
+^I * The timeout in seconds for which a negative lookup will be$

ERROR: code indent should never use tabs
#143: FILE: tools/virtiofsd/fuse.h:123:
+^I * cached. This means, that if file did not exist (lookup$

ERROR: code indent should never use tabs
#144: FILE: tools/virtiofsd/fuse.h:124:
+^I * retuned ENOENT), the lookup will only be redone after the$

ERROR: code indent should never use tabs
#145: FILE: tools/virtiofsd/fuse.h:125:
+^I * timeout, and the file/directory will be assumed to not$

ERROR: code indent should never use tabs
#146: FILE: tools/virtiofsd/fuse.h:126:
+^I * exist until then. A value of zero means that negative$

ERROR: code indent should never use tabs
#147: FILE: tools/virtiofsd/fuse.h:127:
+^I * lookups are not cached.$

ERROR: code indent should never use tabs
#148: FILE: tools/virtiofsd/fuse.h:128:
+^I */$

ERROR: code indent should never use tabs
#149: FILE: tools/virtiofsd/fuse.h:129:
+^Idouble negative_timeout;$

ERROR: code indent should never use tabs
#151: FILE: tools/virtiofsd/fuse.h:131:
+^I/**$

ERROR: code indent should never use tabs
#152: FILE: tools/virtiofsd/fuse.h:132:
+^I * The timeout in seconds for which file/directory attributes$

ERROR: code indent should never use tabs
#153: FILE: tools/virtiofsd/fuse.h:133:
+^I * (as returned by e.g. the getattr handler) are cached.$

ERROR: code indent should never use tabs
#154: FILE: tools/virtiofsd/fuse.h:134:
+^I */$

ERROR: code indent should never use tabs
#155: FILE: tools/virtiofsd/fuse.h:135:
+^Idouble attr_timeout;$

ERROR: code indent should never use tabs
#157: FILE: tools/virtiofsd/fuse.h:137:
+^I/**$

ERROR: code indent should never use tabs
#158: FILE: tools/virtiofsd/fuse.h:138:
+^I * Allow requests to be interrupted$

ERROR: code indent should never use tabs
#159: FILE: tools/virtiofsd/fuse.h:139:
+^I */$

ERROR: code indent should never use tabs
#160: FILE: tools/virtiofsd/fuse.h:140:
+^Iint intr;$

ERROR: code indent should never use tabs
#162: FILE: tools/virtiofsd/fuse.h:142:
+^I/**$

ERROR: code indent should never use tabs
#163: FILE: tools/virtiofsd/fuse.h:143:
+^I * Specify which signal number to send to the filesystem when$

ERROR: code indent should never use tabs
#164: FILE: tools/virtiofsd/fuse.h:144:
+^I * a request is interrupted. The default is hardcoded to$

ERROR: code indent should never use tabs
#165: FILE: tools/virtiofsd/fuse.h:145:
+^I * USR1.$

ERROR: code indent should never use tabs
#166: FILE: tools/virtiofsd/fuse.h:146:
+^I */$

ERROR: code indent should never use tabs
#167: FILE: tools/virtiofsd/fuse.h:147:
+^Iint intr_signal;$

ERROR: code indent should never use tabs
#169: FILE: tools/virtiofsd/fuse.h:149:
+^I/**$

ERROR: code indent should never use tabs
#170: FILE: tools/virtiofsd/fuse.h:150:
+^I * Normally, FUSE assigns inodes to paths only for as long as$

ERROR: code indent should never use tabs
#171: FILE: tools/virtiofsd/fuse.h:151:
+^I * the kernel is aware of them. With this option inodes are$

ERROR: code indent should never use tabs
#172: FILE: tools/virtiofsd/fuse.h:152:
+^I * instead remembered for at least this many seconds. This$

ERROR: code indent should never use tabs
#173: FILE: tools/virtiofsd/fuse.h:153:
+^I * will require more memory, but may be necessary when using$

ERROR: code indent should never use tabs #174: FILE: tools/virtiofsd/fuse.h:154:
+^I * applications that make use of inode numbers.$

ERROR: code indent should never use tabs
#175: FILE: tools/virtiofsd/fuse.h:155:
+^I *$

ERROR: code indent should never use tabs
#176: FILE: tools/virtiofsd/fuse.h:156:
+^I * A number of -1 means that inodes will be remembered for the$

ERROR: code indent should never use tabs #177: FILE: tools/virtiofsd/fuse.h:157:
+^I * entire life-time of the file-system process.$

ERROR: code indent should never use tabs
#178: FILE: tools/virtiofsd/fuse.h:158:
+^I */$

ERROR: code indent should never use tabs
#179: FILE: tools/virtiofsd/fuse.h:159:
+^Iint remember;$

ERROR: code indent should never use tabs
#181: FILE: tools/virtiofsd/fuse.h:161:
+^I/**$

ERROR: code indent should never use tabs
#182: FILE: tools/virtiofsd/fuse.h:162:
+^I * The default behavior is that if an open file is deleted,$

ERROR: code indent should never use tabs
#183: FILE: tools/virtiofsd/fuse.h:163:
+^I * the file is renamed to a hidden file (.fuse_hiddenXXX), and$

ERROR: code indent should never use tabs
#184: FILE: tools/virtiofsd/fuse.h:164:
+^I * only removed when the file is finally released. This$

ERROR: code indent should never use tabs
#185: FILE: tools/virtiofsd/fuse.h:165:
+^I * relieves the filesystem implementation of having to deal$

ERROR: code indent should never use tabs
#186: FILE: tools/virtiofsd/fuse.h:166:
+^I * with this problem. This option disables the hiding$

ERROR: code indent should never use tabs
#187: FILE: tools/virtiofsd/fuse.h:167:
+^I * behavior, and files are removed immediately in an unlink$

ERROR: code indent should never use tabs
#188: FILE: tools/virtiofsd/fuse.h:168:
+^I * operation (or in a rename operation which overwrites an$

ERROR: code indent should never use tabs
#189: FILE: tools/virtiofsd/fuse.h:169:
+^I * existing file).$

ERROR: code indent should never use tabs
#190: FILE: tools/virtiofsd/fuse.h:170:
+^I *$

ERROR: code indent should never use tabs
#191: FILE: tools/virtiofsd/fuse.h:171:
+^I * It is recommended that you not use the hard_remove$

ERROR: code indent should never use tabs
#192: FILE: tools/virtiofsd/fuse.h:172:
+^I * option. When hard_remove is set, the following libc$

ERROR: code indent should never use tabs
#193: FILE: tools/virtiofsd/fuse.h:173:
+^I * functions fail on unlinked files (returning errno of$

ERROR: code indent should never use tabs
#194: FILE: tools/virtiofsd/fuse.h:174:
+^I * ENOENT): read(2), write(2), fsync(2), close(2), f*xattr(2),$

ERROR: code indent should never use tabs #195: FILE: tools/virtiofsd/fuse.h:175:
+^I * ftruncate(2), fstat(2), fchmod(2), fchown(2)$

ERROR: code indent should never use tabs
#196: FILE: tools/virtiofsd/fuse.h:176:
+^I */$

ERROR: code indent should never use tabs
#197: FILE: tools/virtiofsd/fuse.h:177:
+^Iint hard_remove;$

ERROR: code indent should never use tabs
#199: FILE: tools/virtiofsd/fuse.h:179:
+^I/**$

ERROR: code indent should never use tabs
#200: FILE: tools/virtiofsd/fuse.h:180:
+^I * Honor the st_ino field in the functions getattr() and$

ERROR: code indent should never use tabs
#201: FILE: tools/virtiofsd/fuse.h:181:
+^I * fill_dir(). This value is used to fill in the st_ino field$

ERROR: code indent should never use tabs
#202: FILE: tools/virtiofsd/fuse.h:182:
+^I * in the stat(2), lstat(2), fstat(2) functions and the d_ino$

ERROR: code indent should never use tabs
#203: FILE: tools/virtiofsd/fuse.h:183:
+^I * field in the readdir(2) function. The filesystem does not$

ERROR: code indent should never use tabs
#204: FILE: tools/virtiofsd/fuse.h:184:
+^I * have to guarantee uniqueness, however some applications$

ERROR: code indent should never use tabs
#205: FILE: tools/virtiofsd/fuse.h:185:
+^I * rely on this value being unique for the whole filesystem.$

ERROR: code indent should never use tabs
#206: FILE: tools/virtiofsd/fuse.h:186:
+^I *$

ERROR: trailing whitespace
#207: FILE: tools/virtiofsd/fuse.h:187:
+^I * Note that this does *not* affect the inode that libfuse $

ERROR: code indent should never use tabs
#207: FILE: tools/virtiofsd/fuse.h:187:
+^I * Note that this does *not* affect the inode that libfuse $

ERROR: code indent should never use tabs
#208: FILE: tools/virtiofsd/fuse.h:188:
+^I * and the kernel use internally (also called the "nodeid").$

ERROR: code indent should never use tabs
#209: FILE: tools/virtiofsd/fuse.h:189:
+^I */$

ERROR: code indent should never use tabs
#210: FILE: tools/virtiofsd/fuse.h:190:
+^Iint use_ino;$

ERROR: code indent should never use tabs
#212: FILE: tools/virtiofsd/fuse.h:192:
+^I/**$

ERROR: code indent should never use tabs
#213: FILE: tools/virtiofsd/fuse.h:193:
+^I * If use_ino option is not given, still try to fill in the$

ERROR: code indent should never use tabs
#214: FILE: tools/virtiofsd/fuse.h:194:
+^I * d_ino field in readdir(2). If the name was previously$

ERROR: code indent should never use tabs
#215: FILE: tools/virtiofsd/fuse.h:195:
+^I * looked up, and is still in the cache, the inode number$

ERROR: code indent should never use tabs
#216: FILE: tools/virtiofsd/fuse.h:196:
+^I * found there will be used. Otherwise it will be set to -1.$

ERROR: code indent should never use tabs
#217: FILE: tools/virtiofsd/fuse.h:197:
+^I * If use_ino option is given, this option is ignored.$

ERROR: code indent should never use tabs
#218: FILE: tools/virtiofsd/fuse.h:198:
+^I */$

ERROR: code indent should never use tabs
#219: FILE: tools/virtiofsd/fuse.h:199:
+^Iint readdir_ino;$

ERROR: code indent should never use tabs
#221: FILE: tools/virtiofsd/fuse.h:201:
+^I/**$

ERROR: code indent should never use tabs
#222: FILE: tools/virtiofsd/fuse.h:202:
+^I * This option disables the use of page cache (file content cache)$

ERROR: code indent should never use tabs
#223: FILE: tools/virtiofsd/fuse.h:203:
+^I * in the kernel for this filesystem. This has several affects:$

ERROR: code indent should never use tabs
#224: FILE: tools/virtiofsd/fuse.h:204:
+^I *$

ERROR: code indent should never use tabs
#225: FILE: tools/virtiofsd/fuse.h:205:
+^I * 1. Each read(2) or write(2) system call will initiate one$

ERROR: code indent should never use tabs
#226: FILE: tools/virtiofsd/fuse.h:206:
+^I * or more read or write operations, data will not be$

ERROR: code indent should never use tabs
#227: FILE: tools/virtiofsd/fuse.h:207:
+^I * cached in the kernel.$

ERROR: code indent should never use tabs
#228: FILE: tools/virtiofsd/fuse.h:208:
+^I *$

ERROR: code indent should never use tabs
#229: FILE: tools/virtiofsd/fuse.h:209:
+^I * 2. The return value of the read() and write() system calls$

ERROR: code indent should never use tabs
#230: FILE: tools/virtiofsd/fuse.h:210:
+^I * will correspond to the return values of the read and$

ERROR: code indent should never use tabs
#231: FILE: tools/virtiofsd/fuse.h:211:
+^I * write operations. This is useful for example if the$

ERROR: code indent should never use tabs
#232: FILE: tools/virtiofsd/fuse.h:212:
+^I * file size is not known in advance (before reading it).$

ERROR: code indent should never use tabs
#233: FILE: tools/virtiofsd/fuse.h:213:
+^I *$

ERROR: code indent should never use tabs
#234: FILE: tools/virtiofsd/fuse.h:214:
+^I * Internally, enabling this option causes fuse to set the$

ERROR: code indent should never use tabs
#235: FILE: tools/virtiofsd/fuse.h:215:
+^I * direct_io field of struct fuse_file_info - overwriting$

ERROR: code indent should never use tabs
#236: FILE: tools/virtiofsd/fuse.h:216:
+^I * any value that was put there by the file system.$

ERROR: code indent should never use tabs
#237: FILE: tools/virtiofsd/fuse.h:217:
+^I */$

ERROR: code indent should never use tabs
#238: FILE: tools/virtiofsd/fuse.h:218:
+^Iint direct_io;$

ERROR: code indent should never use tabs
#240: FILE: tools/virtiofsd/fuse.h:220:
+^I/**$

ERROR: code indent should never use tabs
#241: FILE: tools/virtiofsd/fuse.h:221:
+^I * This option disables flushing the cache of the file$

ERROR: code indent should never use tabs
#242: FILE: tools/virtiofsd/fuse.h:222:
+^I * contents on every open(2). This should only be enabled on$

ERROR: code indent should never use tabs
#243: FILE: tools/virtiofsd/fuse.h:223:
+^I * filesystems where the file data is never changed$

ERROR: code indent should never use tabs
#244: FILE: tools/virtiofsd/fuse.h:224:
+^I * externally (not through the mounted FUSE filesystem). Thus$

ERROR: code indent should never use tabs
#245: FILE: tools/virtiofsd/fuse.h:225:
+^I * it is not suitable for network filesystems and other$

ERROR: code indent should never use tabs
#246: FILE: tools/virtiofsd/fuse.h:226:
+^I * intermediate filesystems.$

ERROR: code indent should never use tabs
#247: FILE: tools/virtiofsd/fuse.h:227:
+^I *$

ERROR: code indent should never use tabs
#248: FILE: tools/virtiofsd/fuse.h:228:
+^I * NOTE: if this option is not specified (and neither$

ERROR: code indent should never use tabs
#249: FILE: tools/virtiofsd/fuse.h:229:
+^I * direct_io) data is still cached after the open(2), so a$

ERROR: code indent should never use tabs
#250: FILE: tools/virtiofsd/fuse.h:230:
+^I * read(2) system call will not always initiate a read$

ERROR: code indent should never use tabs
#251: FILE: tools/virtiofsd/fuse.h:231:
+^I * operation.$

ERROR: code indent should never use tabs
#252: FILE: tools/virtiofsd/fuse.h:232:
+^I *$

ERROR: code indent should never use tabs
#253: FILE: tools/virtiofsd/fuse.h:233:
+^I * Internally, enabling this option causes fuse to set the$

ERROR: code indent should never use tabs
#254: FILE: tools/virtiofsd/fuse.h:234:
+^I * keep_cache field of struct fuse_file_info - overwriting$

ERROR: code indent should never use tabs
#255: FILE: tools/virtiofsd/fuse.h:235:
+^I * any value that was put there by the file system.$

ERROR: code indent should never use tabs
#256: FILE: tools/virtiofsd/fuse.h:236:
+^I */$

ERROR: code indent should never use tabs
#257: FILE: tools/virtiofsd/fuse.h:237:
+^Iint kernel_cache;$

ERROR: code indent should never use tabs
#259: FILE: tools/virtiofsd/fuse.h:239:
+^I/**$

ERROR: code indent should never use tabs
#260: FILE: tools/virtiofsd/fuse.h:240:
+^I * This option is an alternative to kernel_cache. Instead of$

ERROR: code indent should never use tabs
#261: FILE: tools/virtiofsd/fuse.h:241:
+^I * unconditionally keeping cached data, the cached data is$

ERROR: code indent should never use tabs
#262: FILE: tools/virtiofsd/fuse.h:242:
+^I * invalidated on open(2) if if the modification time or the$

ERROR: code indent should never use tabs
#263: FILE: tools/virtiofsd/fuse.h:243:
+^I * size of the file has changed since it was last opened.$

ERROR: code indent should never use tabs
#264: FILE: tools/virtiofsd/fuse.h:244:
+^I */$

ERROR: code indent should never use tabs
#265: FILE: tools/virtiofsd/fuse.h:245:
+^Iint auto_cache;$

ERROR: code indent should never use tabs
#267: FILE: tools/virtiofsd/fuse.h:247:
+^I/**$

ERROR: code indent should never use tabs
#268: FILE: tools/virtiofsd/fuse.h:248:
+^I * The timeout in seconds for which file attributes are cached$

ERROR: code indent should never use tabs
#269: FILE: tools/virtiofsd/fuse.h:249:
+^I * for the purpose of checking if auto_cache should flush the$

ERROR: code indent should never use tabs
#270: FILE: tools/virtiofsd/fuse.h:250:
+^I * file data on open.$

ERROR: code indent should never use tabs
#271: FILE: tools/virtiofsd/fuse.h:251:
+^I */$

ERROR: code indent should never use tabs
#272: FILE: tools/virtiofsd/fuse.h:252:
+^Iint ac_attr_timeout_set;$

ERROR: code indent should never use tabs
#273: FILE: tools/virtiofsd/fuse.h:253:
+^Idouble ac_attr_timeout;$

ERROR: code indent should never use tabs
#275: FILE: tools/virtiofsd/fuse.h:255:
+^I/**$

ERROR: code indent should never use tabs
#276: FILE: tools/virtiofsd/fuse.h:256:
+^I * If this option is given the file-system handlers for the$

ERROR: code indent should never use tabs
#277: FILE: tools/virtiofsd/fuse.h:257:
+^I * following operations will not receive path information:$

ERROR: code indent should never use tabs
#278: FILE: tools/virtiofsd/fuse.h:258:
+^I * read, write, flush, release, fsync, readdir, releasedir,$

ERROR: code indent should never use tabs
#279: FILE: tools/virtiofsd/fuse.h:259:
+^I * fsyncdir, lock, ioctl and poll.$

ERROR: code indent should never use tabs
#280: FILE: tools/virtiofsd/fuse.h:260:
+^I *$

ERROR: code indent should never use tabs
#281: FILE: tools/virtiofsd/fuse.h:261:
+^I * For the truncate, getattr, chmod, chown and utimens$

ERROR: code indent should never use tabs
#282: FILE: tools/virtiofsd/fuse.h:262:
+^I * operations the path will be provided only if the struct$

ERROR: code indent should never use tabs
#283: FILE: tools/virtiofsd/fuse.h:263:
+^I * fuse_file_info argument is NULL.$

ERROR: code indent should never use tabs
#284: FILE: tools/virtiofsd/fuse.h:264:
+^I */$

ERROR: code indent should never use tabs
#285: FILE: tools/virtiofsd/fuse.h:265:
+^Iint nullpath_ok;$

ERROR: code indent should never use tabs
#287: FILE: tools/virtiofsd/fuse.h:267:
+^I/**$

ERROR: code indent should never use tabs
#288: FILE: tools/virtiofsd/fuse.h:268:
+^I * The remaining options are used by libfuse internally and$

ERROR: code indent should never use tabs
#289: FILE: tools/virtiofsd/fuse.h:269:
+^I * should not be touched.$

ERROR: code indent should never use tabs
#290: FILE: tools/virtiofsd/fuse.h:270:
+^I */$

ERROR: code indent should never use tabs
#291: FILE: tools/virtiofsd/fuse.h:271:
+^Iint show_help;$

ERROR: code indent should never use tabs
#292: FILE: tools/virtiofsd/fuse.h:272:
+^Ichar *modules;$

ERROR: code indent should never use tabs
#293: FILE: tools/virtiofsd/fuse.h:273:
+^Iint debug;$

ERROR: code indent should never use tabs
#320: FILE: tools/virtiofsd/fuse.h:300:
+^I/** Get file attributes.$

WARNING: Block comments use a leading /* on a separate line #320: FILE: tools/virtiofsd/fuse.h:300:
+ /** Get file attributes.

ERROR: code indent should never use tabs
#321: FILE: tools/virtiofsd/fuse.h:301:
+^I *$

ERROR: code indent should never use tabs
#322: FILE: tools/virtiofsd/fuse.h:302:
+^I * Similar to stat(). The 'st_dev' and 'st_blksize' fields are$

ERROR: code indent should never use tabs
#323: FILE: tools/virtiofsd/fuse.h:303:
+^I * ignored. The 'st_ino' field is ignored except if the 'use_ino'$

ERROR: code indent should never use tabs
#324: FILE: tools/virtiofsd/fuse.h:304:
+^I * mount option is given. In that case it is passed to userspace,$

ERROR: code indent should never use tabs
#325: FILE: tools/virtiofsd/fuse.h:305:
+^I * but libfuse and the kernel will still assign a different$

ERROR: code indent should never use tabs #326: FILE: tools/virtiofsd/fuse.h:306:
+^I * inode for internal use (called the "nodeid").$

ERROR: code indent should never use tabs
#327: FILE: tools/virtiofsd/fuse.h:307:
+^I *$

ERROR: code indent should never use tabs
#328: FILE: tools/virtiofsd/fuse.h:308:
+^I * fi will always be NULL if the file is not currently open, but$

ERROR: code indent should never use tabs
#329: FILE: tools/virtiofsd/fuse.h:309:
+^I * may also be NULL if the file is open.$

ERROR: code indent should never use tabs
#330: FILE: tools/virtiofsd/fuse.h:310:
+^I */$

ERROR: code indent should never use tabs
#331: FILE: tools/virtiofsd/fuse.h:311:
+^Iint (*getattr) (const char *, struct stat *, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#333: FILE: tools/virtiofsd/fuse.h:313:
+^I/** Read the target of a symbolic link$

WARNING: Block comments use a leading /* on a separate line #333: FILE: tools/virtiofsd/fuse.h:313:
+ /** Read the target of a symbolic link

ERROR: code indent should never use tabs
#334: FILE: tools/virtiofsd/fuse.h:314:
+^I *$

ERROR: code indent should never use tabs
#335: FILE: tools/virtiofsd/fuse.h:315:
+^I * The buffer should be filled with a null terminated string. The$

ERROR: code indent should never use tabs
#336: FILE: tools/virtiofsd/fuse.h:316:
+^I * buffer size argument includes the space for the terminating$

ERROR: code indent should never use tabs
#337: FILE: tools/virtiofsd/fuse.h:317:
+^I * null character.^IIf the linkname is too long to fit in the$

ERROR: code indent should never use tabs
#338: FILE: tools/virtiofsd/fuse.h:318:
+^I * buffer, it should be truncated.^IThe return value should be 0$

ERROR: code indent should never use tabs
#339: FILE: tools/virtiofsd/fuse.h:319:
+^I * for success.$

ERROR: code indent should never use tabs
#340: FILE: tools/virtiofsd/fuse.h:320:
+^I */$

ERROR: code indent should never use tabs #341: FILE: tools/virtiofsd/fuse.h:321:
+^Iint (*readlink) (const char *, char *, size_t);$

ERROR: code indent should never use tabs
#343: FILE: tools/virtiofsd/fuse.h:323:
+^I/** Create a file node$

WARNING: Block comments use a leading /* on a separate line #343: FILE: tools/virtiofsd/fuse.h:323:
+ /** Create a file node

ERROR: code indent should never use tabs
#344: FILE: tools/virtiofsd/fuse.h:324:
+^I *$

ERROR: code indent should never use tabs
#345: FILE: tools/virtiofsd/fuse.h:325:
+^I * This is called for creation of all non-directory, non-symlink$

ERROR: code indent should never use tabs
#346: FILE: tools/virtiofsd/fuse.h:326:
+^I * nodes. If the filesystem defines a create() method, then for$

ERROR: code indent should never use tabs
#347: FILE: tools/virtiofsd/fuse.h:327:
+^I * regular files that will be called instead.$

ERROR: code indent should never use tabs
#348: FILE: tools/virtiofsd/fuse.h:328:
+^I */$

ERROR: code indent should never use tabs
#349: FILE: tools/virtiofsd/fuse.h:329:
+^Iint (*mknod) (const char *, mode_t, dev_t);$

ERROR: code indent should never use tabs
#351: FILE: tools/virtiofsd/fuse.h:331:
+^I/** Create a directory$

WARNING: Block comments use a leading /* on a separate line #351: FILE: tools/virtiofsd/fuse.h:331:
+ /** Create a directory

ERROR: code indent should never use tabs
#352: FILE: tools/virtiofsd/fuse.h:332:
+^I *$

ERROR: code indent should never use tabs
#353: FILE: tools/virtiofsd/fuse.h:333:
+^I * Note that the mode argument may not have the type specification$

ERROR: code indent should never use tabs
#354: FILE: tools/virtiofsd/fuse.h:334:
+^I * bits set, i.e. S_ISDIR(mode) can be false. To obtain the$

ERROR: code indent should never use tabs #355: FILE: tools/virtiofsd/fuse.h:335:
+^I * correct directory type bits use mode|S_IFDIR$

ERROR: code indent should never use tabs
#356: FILE: tools/virtiofsd/fuse.h:336:
+^I * */$

WARNING: Block comments use a trailing */ on a separate line #356: FILE: tools/virtiofsd/fuse.h:336:
+ * */

ERROR: code indent should never use tabs
#357: FILE: tools/virtiofsd/fuse.h:337:
+^Iint (*mkdir) (const char *, mode_t);$

ERROR: code indent should never use tabs
#359: FILE: tools/virtiofsd/fuse.h:339:
+^I/** Remove a file */$

ERROR: code indent should never use tabs
#360: FILE: tools/virtiofsd/fuse.h:340:
+^Iint (*unlink) (const char *);$

ERROR: code indent should never use tabs
#362: FILE: tools/virtiofsd/fuse.h:342:
+^I/** Remove a directory */$

ERROR: code indent should never use tabs
#363: FILE: tools/virtiofsd/fuse.h:343:
+^Iint (*rmdir) (const char *);$

ERROR: code indent should never use tabs
#365: FILE: tools/virtiofsd/fuse.h:345:
+^I/** Create a symbolic link */$

ERROR: code indent should never use tabs
#366: FILE: tools/virtiofsd/fuse.h:346:
+^Iint (*symlink) (const char *, const char *);$

ERROR: code indent should never use tabs
#368: FILE: tools/virtiofsd/fuse.h:348:
+^I/** Rename a file$

WARNING: Block comments use a leading /* on a separate line #368: FILE: tools/virtiofsd/fuse.h:348:
+ /** Rename a file

ERROR: code indent should never use tabs
#369: FILE: tools/virtiofsd/fuse.h:349:
+^I *$

ERROR: code indent should never use tabs
#370: FILE: tools/virtiofsd/fuse.h:350:
+^I * *flags* may be RENAME_EXCHANGE or RENAME_NOREPLACE. If$

ERROR: code indent should never use tabs
#371: FILE: tools/virtiofsd/fuse.h:351:
+^I * RENAME_NOREPLACE is specified, the filesystem must not$

ERROR: code indent should never use tabs
#372: FILE: tools/virtiofsd/fuse.h:352:
+^I * overwrite *newname* if it exists and return an error$

ERROR: code indent should never use tabs
#373: FILE: tools/virtiofsd/fuse.h:353:
+^I * instead. If RENAME_EXCHANGE is specified, the filesystem$

ERROR: code indent should never use tabs
#374: FILE: tools/virtiofsd/fuse.h:354:
+^I * must atomically exchange the two files, i.e. both must$

ERROR: code indent should never use tabs
#375: FILE: tools/virtiofsd/fuse.h:355:
+^I * exist and neither may be deleted.$

ERROR: code indent should never use tabs
#376: FILE: tools/virtiofsd/fuse.h:356:
+^I */$

ERROR: code indent should never use tabs
#377: FILE: tools/virtiofsd/fuse.h:357:
+^Iint (*rename) (const char *, const char *, unsigned int flags);$

ERROR: code indent should never use tabs
#379: FILE: tools/virtiofsd/fuse.h:359:
+^I/** Create a hard link to a file */$

ERROR: code indent should never use tabs
#380: FILE: tools/virtiofsd/fuse.h:360:
+^Iint (*link) (const char *, const char *);$

ERROR: code indent should never use tabs
#382: FILE: tools/virtiofsd/fuse.h:362:
+^I/** Change the permission bits of a file$

WARNING: Block comments use a leading /* on a separate line #382: FILE: tools/virtiofsd/fuse.h:362:
+ /** Change the permission bits of a file

ERROR: code indent should never use tabs
#383: FILE: tools/virtiofsd/fuse.h:363:
+^I *$

ERROR: code indent should never use tabs
#384: FILE: tools/virtiofsd/fuse.h:364:
+^I * fi will always be NULL if the file is not currenlty open, but$

ERROR: code indent should never use tabs
#385: FILE: tools/virtiofsd/fuse.h:365:
+^I * may also be NULL if the file is open.$

ERROR: code indent should never use tabs
#386: FILE: tools/virtiofsd/fuse.h:366:
+^I */$

ERROR: code indent should never use tabs
#387: FILE: tools/virtiofsd/fuse.h:367:
+^Iint (*chmod) (const char *, mode_t, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#389: FILE: tools/virtiofsd/fuse.h:369:
+^I/** Change the owner and group of a file$

WARNING: Block comments use a leading /* on a separate line #389: FILE: tools/virtiofsd/fuse.h:369:
+ /** Change the owner and group of a file

ERROR: code indent should never use tabs
#390: FILE: tools/virtiofsd/fuse.h:370:
+^I *$

ERROR: code indent should never use tabs
#391: FILE: tools/virtiofsd/fuse.h:371:
+^I * fi will always be NULL if the file is not currenlty open, but$

ERROR: code indent should never use tabs
#392: FILE: tools/virtiofsd/fuse.h:372:
+^I * may also be NULL if the file is open.$

ERROR: code indent should never use tabs
#393: FILE: tools/virtiofsd/fuse.h:373:
+^I *$

ERROR: code indent should never use tabs
#394: FILE: tools/virtiofsd/fuse.h:374:
+^I * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is$

ERROR: code indent should never use tabs #395: FILE: tools/virtiofsd/fuse.h:375:
+^I * expected to reset the setuid and setgid bits.$

ERROR: code indent should never use tabs
#396: FILE: tools/virtiofsd/fuse.h:376:
+^I */$

ERROR: code indent should never use tabs
#397: FILE: tools/virtiofsd/fuse.h:377:
+^Iint (*chown) (const char *, uid_t, gid_t, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#399: FILE: tools/virtiofsd/fuse.h:379:
+^I/** Change the size of a file$

WARNING: Block comments use a leading /* on a separate line #399: FILE: tools/virtiofsd/fuse.h:379:
+ /** Change the size of a file

ERROR: code indent should never use tabs
#400: FILE: tools/virtiofsd/fuse.h:380:
+^I *$

ERROR: code indent should never use tabs
#401: FILE: tools/virtiofsd/fuse.h:381:
+^I * fi will always be NULL if the file is not currenlty open, but$

ERROR: code indent should never use tabs
#402: FILE: tools/virtiofsd/fuse.h:382:
+^I * may also be NULL if the file is open.$

ERROR: code indent should never use tabs
#403: FILE: tools/virtiofsd/fuse.h:383:
+^I *$

ERROR: code indent should never use tabs
#404: FILE: tools/virtiofsd/fuse.h:384:
+^I * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is$

ERROR: code indent should never use tabs #405: FILE: tools/virtiofsd/fuse.h:385:
+^I * expected to reset the setuid and setgid bits.$

ERROR: code indent should never use tabs
#406: FILE: tools/virtiofsd/fuse.h:386:
+^I */$

ERROR: code indent should never use tabs
#407: FILE: tools/virtiofsd/fuse.h:387:
+^Iint (*truncate) (const char *, off_t, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#409: FILE: tools/virtiofsd/fuse.h:389:
+^I/** Open a file$

WARNING: Block comments use a leading /* on a separate line #409: FILE: tools/virtiofsd/fuse.h:389:
+ /** Open a file

ERROR: code indent should never use tabs
#410: FILE: tools/virtiofsd/fuse.h:390:
+^I *$

ERROR: code indent should never use tabs
#411: FILE: tools/virtiofsd/fuse.h:391:
+^I * Open flags are available in fi->flags. The following rules$

ERROR: code indent should never use tabs
#412: FILE: tools/virtiofsd/fuse.h:392:
+^I * apply.$

ERROR: code indent should never use tabs
#413: FILE: tools/virtiofsd/fuse.h:393:
+^I *$

ERROR: code indent should never use tabs
#414: FILE: tools/virtiofsd/fuse.h:394:
+^I * - Creation (O_CREAT, O_EXCL, O_NOCTTY) flags will be$

ERROR: code indent should never use tabs
#415: FILE: tools/virtiofsd/fuse.h:395:
+^I * filtered out / handled by the kernel.$

ERROR: code indent should never use tabs
#416: FILE: tools/virtiofsd/fuse.h:396:
+^I *$

ERROR: code indent should never use tabs
#417: FILE: tools/virtiofsd/fuse.h:397:
+^I * - Access modes (O_RDONLY, O_WRONLY, O_RDWR, O_EXEC, O_SEARCH)$

ERROR: code indent should never use tabs
#418: FILE: tools/virtiofsd/fuse.h:398:
+^I * should be used by the filesystem to check if the operation is$

ERROR: code indent should never use tabs
#419: FILE: tools/virtiofsd/fuse.h:399:
+^I * permitted. If the ``-o default_permissions`` mount option is$

ERROR: code indent should never use tabs
#420: FILE: tools/virtiofsd/fuse.h:400:
+^I * given, this check is already done by the kernel before calling$

ERROR: code indent should never use tabs
#421: FILE: tools/virtiofsd/fuse.h:401:
+^I * open() and may thus be omitted by the filesystem.$

ERROR: code indent should never use tabs
#422: FILE: tools/virtiofsd/fuse.h:402:
+^I *$

ERROR: code indent should never use tabs
#423: FILE: tools/virtiofsd/fuse.h:403:
+^I * - When writeback caching is enabled, the kernel may send$

ERROR: code indent should never use tabs
#424: FILE: tools/virtiofsd/fuse.h:404:
+^I * read requests even for files opened with O_WRONLY. The$

ERROR: code indent should never use tabs
#425: FILE: tools/virtiofsd/fuse.h:405:
+^I * filesystem should be prepared to handle this.$

ERROR: code indent should never use tabs
#426: FILE: tools/virtiofsd/fuse.h:406:
+^I *$

ERROR: code indent should never use tabs
#427: FILE: tools/virtiofsd/fuse.h:407:
+^I * - When writeback caching is disabled, the filesystem is$

ERROR: code indent should never use tabs
#428: FILE: tools/virtiofsd/fuse.h:408:
+^I * expected to properly handle the O_APPEND flag and ensure$

ERROR: code indent should never use tabs
#429: FILE: tools/virtiofsd/fuse.h:409:
+^I * that each write is appending to the end of the file.$

ERROR: trailing whitespace
#430: FILE: tools/virtiofsd/fuse.h:410:
+^I * $

ERROR: code indent should never use tabs
#430: FILE: tools/virtiofsd/fuse.h:410:
+^I * $

ERROR: code indent should never use tabs
#432: FILE: tools/virtiofsd/fuse.h:412:
+^I * handle O_APPEND. However, unless all changes to the file$

ERROR: code indent should never use tabs
#433: FILE: tools/virtiofsd/fuse.h:413:
+^I * come through the kernel this will not work reliably. The$

ERROR: code indent should never use tabs
#434: FILE: tools/virtiofsd/fuse.h:414:
+^I * filesystem should thus either ignore the O_APPEND flag$

ERROR: code indent should never use tabs
#435: FILE: tools/virtiofsd/fuse.h:415:
+^I * (and let the kernel handle it), or return an error$

ERROR: code indent should never use tabs
#436: FILE: tools/virtiofsd/fuse.h:416:
+^I * (indicating that reliably O_APPEND is not available).$

ERROR: code indent should never use tabs
#437: FILE: tools/virtiofsd/fuse.h:417:
+^I *$

ERROR: code indent should never use tabs
#438: FILE: tools/virtiofsd/fuse.h:418:
+^I * Filesystem may store an arbitrary file handle (pointer,$

ERROR: code indent should never use tabs
#439: FILE: tools/virtiofsd/fuse.h:419:
+^I * index, etc) in fi->fh, and use this in other all other file$

ERROR: code indent should never use tabs
#440: FILE: tools/virtiofsd/fuse.h:420:
+^I * operations (read, write, flush, release, fsync).$

ERROR: code indent should never use tabs
#441: FILE: tools/virtiofsd/fuse.h:421:
+^I *$

ERROR: code indent should never use tabs
#442: FILE: tools/virtiofsd/fuse.h:422:
+^I * Filesystem may also implement stateless file I/O and not store$

ERROR: code indent should never use tabs
#443: FILE: tools/virtiofsd/fuse.h:423:
+^I * anything in fi->fh.$

ERROR: code indent should never use tabs
#444: FILE: tools/virtiofsd/fuse.h:424:
+^I *$

ERROR: code indent should never use tabs
#445: FILE: tools/virtiofsd/fuse.h:425:
+^I * There are also some flags (direct_io, keep_cache) which the$

ERROR: code indent should never use tabs
#446: FILE: tools/virtiofsd/fuse.h:426:
+^I * filesystem may set in fi, to change the way the file is opened.$

ERROR: code indent should never use tabs
#447: FILE: tools/virtiofsd/fuse.h:427:
+^I * See fuse_file_info structure in <fuse_common.h> for more details.$

ERROR: code indent should never use tabs
#448: FILE: tools/virtiofsd/fuse.h:428:
+^I *$

ERROR: code indent should never use tabs
#449: FILE: tools/virtiofsd/fuse.h:429:
+^I * If this request is answered with an error code of ENOSYS$

ERROR: code indent should never use tabs
#450: FILE: tools/virtiofsd/fuse.h:430:
+^I * and FUSE_CAP_NO_OPEN_SUPPORT is set in$

ERROR: code indent should never use tabs
#451: FILE: tools/virtiofsd/fuse.h:431:
+^I * fuse_conn_info.capable, this is treated as success and$

ERROR: code indent should never use tabs
#452: FILE: tools/virtiofsd/fuse.h:432:
+^I * future calls to open will also succeed without being send$

ERROR: code indent should never use tabs
#453: FILE: tools/virtiofsd/fuse.h:433:
+^I * to the filesystem process.$

ERROR: code indent should never use tabs
#454: FILE: tools/virtiofsd/fuse.h:434:
+^I *$

ERROR: code indent should never use tabs
#455: FILE: tools/virtiofsd/fuse.h:435:
+^I */$

ERROR: code indent should never use tabs
#456: FILE: tools/virtiofsd/fuse.h:436:
+^Iint (*open) (const char *, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#458: FILE: tools/virtiofsd/fuse.h:438:
+^I/** Read data from an open file$

WARNING: Block comments use a leading /* on a separate line #458: FILE: tools/virtiofsd/fuse.h:438:
+ /** Read data from an open file

ERROR: code indent should never use tabs
#459: FILE: tools/virtiofsd/fuse.h:439:
+^I *$

ERROR: code indent should never use tabs
#460: FILE: tools/virtiofsd/fuse.h:440:
+^I * Read should return exactly the number of bytes requested except$

ERROR: code indent should never use tabs
#461: FILE: tools/virtiofsd/fuse.h:441:
+^I * on EOF or error, otherwise the rest of the data will be$

ERROR: code indent should never use tabs
#462: FILE: tools/virtiofsd/fuse.h:442:
+^I * substituted with zeroes.^I An exception to this is when the$

ERROR: code indent should never use tabs
#463: FILE: tools/virtiofsd/fuse.h:443:
+^I * 'direct_io' mount option is specified, in which case the return$

ERROR: code indent should never use tabs
#464: FILE: tools/virtiofsd/fuse.h:444:
+^I * value of the read system call will reflect the return value of$

ERROR: code indent should never use tabs
#465: FILE: tools/virtiofsd/fuse.h:445:
+^I * this operation.$

ERROR: code indent should never use tabs
#466: FILE: tools/virtiofsd/fuse.h:446:
+^I */$

ERROR: code indent should never use tabs #467: FILE: tools/virtiofsd/fuse.h:447:
+^Iint (*read) (const char *, char *, size_t, off_t,$

ERROR: code indent should never use tabs
#468: FILE: tools/virtiofsd/fuse.h:448:
+^I^I struct fuse_file_info *);$

ERROR: code indent should never use tabs
#470: FILE: tools/virtiofsd/fuse.h:450:
+^I/** Write data to an open file$

WARNING: Block comments use a leading /* on a separate line #470: FILE: tools/virtiofsd/fuse.h:450:
+ /** Write data to an open file

ERROR: code indent should never use tabs
#471: FILE: tools/virtiofsd/fuse.h:451:
+^I *$

ERROR: code indent should never use tabs
#472: FILE: tools/virtiofsd/fuse.h:452:
+^I * Write should return exactly the number of bytes requested$

ERROR: code indent should never use tabs
#473: FILE: tools/virtiofsd/fuse.h:453:
+^I * except on error.^I An exception to this is when the 'direct_io'$

ERROR: code indent should never use tabs #474: FILE: tools/virtiofsd/fuse.h:454:
+^I * mount option is specified (see read operation).$

ERROR: code indent should never use tabs
#475: FILE: tools/virtiofsd/fuse.h:455:
+^I *$

ERROR: code indent should never use tabs
#476: FILE: tools/virtiofsd/fuse.h:456:
+^I * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is$

ERROR: code indent should never use tabs #477: FILE: tools/virtiofsd/fuse.h:457:
+^I * expected to reset the setuid and setgid bits.$

ERROR: code indent should never use tabs
#478: FILE: tools/virtiofsd/fuse.h:458:
+^I */$

ERROR: code indent should never use tabs
#479: FILE: tools/virtiofsd/fuse.h:459:
+^Iint (*write) (const char *, const char *, size_t, off_t,$

ERROR: code indent should never use tabs
#480: FILE: tools/virtiofsd/fuse.h:460:
+^I^I struct fuse_file_info *);$

ERROR: code indent should never use tabs
#482: FILE: tools/virtiofsd/fuse.h:462:
+^I/** Get file system statistics$

WARNING: Block comments use a leading /* on a separate line #482: FILE: tools/virtiofsd/fuse.h:462:
+ /** Get file system statistics

ERROR: code indent should never use tabs
#483: FILE: tools/virtiofsd/fuse.h:463:
+^I *$

ERROR: code indent should never use tabs
#484: FILE: tools/virtiofsd/fuse.h:464:
+^I * The 'f_favail', 'f_fsid' and 'f_flag' fields are ignored$

ERROR: code indent should never use tabs
#485: FILE: tools/virtiofsd/fuse.h:465:
+^I */$

ERROR: code indent should never use tabs #486: FILE: tools/virtiofsd/fuse.h:466:
+^Iint (*statfs) (const char *, struct statvfs *);$

ERROR: code indent should never use tabs
#488: FILE: tools/virtiofsd/fuse.h:468:
+^I/** Possibly flush cached data$

WARNING: Block comments use a leading /* on a separate line #488: FILE: tools/virtiofsd/fuse.h:468:
+ /** Possibly flush cached data

ERROR: code indent should never use tabs
#489: FILE: tools/virtiofsd/fuse.h:469:
+^I *$

ERROR: code indent should never use tabs
#490: FILE: tools/virtiofsd/fuse.h:470:
+^I * BIG NOTE: This is not equivalent to fsync(). It's not a$

ERROR: code indent should never use tabs
#491: FILE: tools/virtiofsd/fuse.h:471:
+^I * request to sync dirty data.$

ERROR: code indent should never use tabs
#492: FILE: tools/virtiofsd/fuse.h:472:
+^I *$

ERROR: code indent should never use tabs
#493: FILE: tools/virtiofsd/fuse.h:473:
+^I * Flush is called on each close() of a file descriptor, as opposed to$

ERROR: code indent should never use tabs
#494: FILE: tools/virtiofsd/fuse.h:474:
+^I * release which is called on the close of the last file descriptor for$

ERROR: trailing whitespace
#495: FILE: tools/virtiofsd/fuse.h:475:
+^I * a file. Under Linux, errors returned by flush() will be passed to $

ERROR: code indent should never use tabs
#495: FILE: tools/virtiofsd/fuse.h:475:
+^I * a file. Under Linux, errors returned by flush() will be passed to $

ERROR: code indent should never use tabs
#496: FILE: tools/virtiofsd/fuse.h:476:
+^I * userspace as errors from close(), so flush() is a good place to write$

ERROR: trailing whitespace
#497: FILE: tools/virtiofsd/fuse.h:477:
+^I * back any cached dirty data. However, many applications ignore errors $

ERROR: code indent should never use tabs
#497: FILE: tools/virtiofsd/fuse.h:477:
+^I * back any cached dirty data. However, many applications ignore errors $

WARNING: line over 80 characters
#498: FILE: tools/virtiofsd/fuse.h:478:
+ * on close(), and on non-Linux systems, close() may succeed even if flush()

ERROR: code indent should never use tabs
#498: FILE: tools/virtiofsd/fuse.h:478:
+^I * on close(), and on non-Linux systems, close() may succeed even if flush()$

ERROR: code indent should never use tabs
#499: FILE: tools/virtiofsd/fuse.h:479:
+^I * returns an error. For these reasons, filesystems should not assume$

ERROR: code indent should never use tabs
#500: FILE: tools/virtiofsd/fuse.h:480:
+^I * that errors returned by flush will ever be noticed or even$

ERROR: code indent should never use tabs
#501: FILE: tools/virtiofsd/fuse.h:481:
+^I * delivered.$

ERROR: code indent should never use tabs
#502: FILE: tools/virtiofsd/fuse.h:482:
+^I *$

ERROR: code indent should never use tabs
#503: FILE: tools/virtiofsd/fuse.h:483:
+^I * NOTE: The flush() method may be called more than once for each$

ERROR: code indent should never use tabs
#504: FILE: tools/virtiofsd/fuse.h:484:
+^I * open(). This happens if more than one file descriptor refers to an$

ERROR: code indent should never use tabs
#505: FILE: tools/virtiofsd/fuse.h:485:
+^I * open file handle, e.g. due to dup(), dup2() or fork() calls. It is$

ERROR: code indent should never use tabs
#506: FILE: tools/virtiofsd/fuse.h:486:
+^I * not possible to determine if a flush is final, so each flush should$

ERROR: code indent should never use tabs
#507: FILE: tools/virtiofsd/fuse.h:487:
+^I * be treated equally. Multiple write-flush sequences are relatively$

ERROR: code indent should never use tabs
#508: FILE: tools/virtiofsd/fuse.h:488:
+^I * rare, so this shouldn't be a problem.$

ERROR: code indent should never use tabs
#509: FILE: tools/virtiofsd/fuse.h:489:
+^I *$

ERROR: code indent should never use tabs
#510: FILE: tools/virtiofsd/fuse.h:490:
+^I * Filesystems shouldn't assume that flush will be called at any$

ERROR: code indent should never use tabs
#511: FILE: tools/virtiofsd/fuse.h:491:
+^I * particular point. It may be called more times than expected, or not$

ERROR: code indent should never use tabs
#512: FILE: tools/virtiofsd/fuse.h:492:
+^I * at all.$

ERROR: code indent should never use tabs
#513: FILE: tools/virtiofsd/fuse.h:493:
+^I *$

WARNING: line over 80 characters
#514: FILE: tools/virtiofsd/fuse.h:494:
+ * [close]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html

ERROR: code indent should never use tabs
#514: FILE: tools/virtiofsd/fuse.h:494:
+^I * [close]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html$

ERROR: code indent should never use tabs
#515: FILE: tools/virtiofsd/fuse.h:495:
+^I */$

ERROR: code indent should never use tabs
#516: FILE: tools/virtiofsd/fuse.h:496:
+^Iint (*flush) (const char *, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#518: FILE: tools/virtiofsd/fuse.h:498:
+^I/** Release an open file$

WARNING: Block comments use a leading /* on a separate line #518: FILE: tools/virtiofsd/fuse.h:498:
+ /** Release an open file

ERROR: code indent should never use tabs
#519: FILE: tools/virtiofsd/fuse.h:499:
+^I *$

ERROR: code indent should never use tabs
#520: FILE: tools/virtiofsd/fuse.h:500:
+^I * Release is called when there are no more references to an open$

ERROR: code indent should never use tabs
#521: FILE: tools/virtiofsd/fuse.h:501:
+^I * file: all file descriptors are closed and all memory mappings$

ERROR: code indent should never use tabs
#522: FILE: tools/virtiofsd/fuse.h:502:
+^I * are unmapped.$

ERROR: code indent should never use tabs
#523: FILE: tools/virtiofsd/fuse.h:503:
+^I *$

ERROR: code indent should never use tabs
#524: FILE: tools/virtiofsd/fuse.h:504:
+^I * For every open() call there will be exactly one release() call$

ERROR: code indent should never use tabs
#525: FILE: tools/virtiofsd/fuse.h:505:
+^I * with the same flags and file handle. It is possible to$

ERROR: code indent should never use tabs
#526: FILE: tools/virtiofsd/fuse.h:506:
+^I * have a file opened more than once, in which case only the last$

ERROR: code indent should never use tabs
#527: FILE: tools/virtiofsd/fuse.h:507:
+^I * release will mean, that no more reads/writes will happen on the$

ERROR: code indent should never use tabs #528: FILE: tools/virtiofsd/fuse.h:508:
+^I * file. The return value of release is ignored.$

ERROR: code indent should never use tabs
#529: FILE: tools/virtiofsd/fuse.h:509:
+^I */$

ERROR: code indent should never use tabs
#530: FILE: tools/virtiofsd/fuse.h:510:
+^Iint (*release) (const char *, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#532: FILE: tools/virtiofsd/fuse.h:512:
+^I/** Synchronize file contents$

WARNING: Block comments use a leading /* on a separate line #532: FILE: tools/virtiofsd/fuse.h:512:
+ /** Synchronize file contents

ERROR: code indent should never use tabs
#533: FILE: tools/virtiofsd/fuse.h:513:
+^I *$

ERROR: code indent should never use tabs
#534: FILE: tools/virtiofsd/fuse.h:514:
+^I * If the datasync parameter is non-zero, then only the user data$

ERROR: code indent should never use tabs
#535: FILE: tools/virtiofsd/fuse.h:515:
+^I * should be flushed, not the meta data.$

ERROR: code indent should never use tabs
#536: FILE: tools/virtiofsd/fuse.h:516:
+^I */$

ERROR: code indent should never use tabs
#537: FILE: tools/virtiofsd/fuse.h:517:
+^Iint (*fsync) (const char *, int, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#539: FILE: tools/virtiofsd/fuse.h:519:
+^I/** Set extended attributes */$

ERROR: code indent should never use tabs
#540: FILE: tools/virtiofsd/fuse.h:520:
+^Iint (*setxattr) (const char *, const char *, const char *, size_t, int);$

ERROR: code indent should never use tabs
#542: FILE: tools/virtiofsd/fuse.h:522:
+^I/** Get extended attributes */$

ERROR: code indent should never use tabs
#543: FILE: tools/virtiofsd/fuse.h:523:
+^Iint (*getxattr) (const char *, const char *, char *, size_t);$

ERROR: code indent should never use tabs
#545: FILE: tools/virtiofsd/fuse.h:525:
+^I/** List extended attributes */$

ERROR: code indent should never use tabs #546: FILE: tools/virtiofsd/fuse.h:526:
+^Iint (*listxattr) (const char *, char *, size_t);$

ERROR: code indent should never use tabs
#548: FILE: tools/virtiofsd/fuse.h:528:
+^I/** Remove extended attributes */$

ERROR: code indent should never use tabs #549: FILE: tools/virtiofsd/fuse.h:529:
+^Iint (*removexattr) (const char *, const char *);$

ERROR: code indent should never use tabs
#551: FILE: tools/virtiofsd/fuse.h:531:
+^I/** Open directory$

WARNING: Block comments use a leading /* on a separate line #551: FILE: tools/virtiofsd/fuse.h:531:
+ /** Open directory

ERROR: code indent should never use tabs
#552: FILE: tools/virtiofsd/fuse.h:532:
+^I *$

ERROR: code indent should never use tabs
#553: FILE: tools/virtiofsd/fuse.h:533:
+^I * Unless the 'default_permissions' mount option is given,$

ERROR: code indent should never use tabs
#554: FILE: tools/virtiofsd/fuse.h:534:
+^I * this method should check if opendir is permitted for this$

ERROR: code indent should never use tabs
#555: FILE: tools/virtiofsd/fuse.h:535:
+^I * directory. Optionally opendir may also return an arbitrary$

ERROR: code indent should never use tabs
#556: FILE: tools/virtiofsd/fuse.h:536:
+^I * filehandle in the fuse_file_info structure, which will be$

ERROR: code indent should never use tabs #557: FILE: tools/virtiofsd/fuse.h:537:
+^I * passed to readdir, releasedir and fsyncdir.$

ERROR: code indent should never use tabs
#558: FILE: tools/virtiofsd/fuse.h:538:
+^I */$

ERROR: code indent should never use tabs
#559: FILE: tools/virtiofsd/fuse.h:539:
+^Iint (*opendir) (const char *, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#561: FILE: tools/virtiofsd/fuse.h:541:
+^I/** Read directory$

WARNING: Block comments use a leading /* on a separate line #561: FILE: tools/virtiofsd/fuse.h:541:
+ /** Read directory

ERROR: code indent should never use tabs
#562: FILE: tools/virtiofsd/fuse.h:542:
+^I *$

ERROR: code indent should never use tabs
#563: FILE: tools/virtiofsd/fuse.h:543:
+^I * The filesystem may choose between two modes of operation:$

ERROR: code indent should never use tabs
#564: FILE: tools/virtiofsd/fuse.h:544:
+^I *$

ERROR: code indent should never use tabs
#565: FILE: tools/virtiofsd/fuse.h:545:
+^I * 1) The readdir implementation ignores the offset parameter, and$

ERROR: code indent should never use tabs
#566: FILE: tools/virtiofsd/fuse.h:546:
+^I * passes zero to the filler function's offset. The filler$

ERROR: code indent should never use tabs
#567: FILE: tools/virtiofsd/fuse.h:547:
+^I * function will not return '1' (unless an error happens), so the$

ERROR: code indent should never use tabs
#568: FILE: tools/virtiofsd/fuse.h:548:
+^I * whole directory is read in a single readdir operation.$

ERROR: code indent should never use tabs
#569: FILE: tools/virtiofsd/fuse.h:549:
+^I *$

ERROR: code indent should never use tabs
#570: FILE: tools/virtiofsd/fuse.h:550:
+^I * 2) The readdir implementation keeps track of the offsets of the$

ERROR: code indent should never use tabs
#571: FILE: tools/virtiofsd/fuse.h:551:
+^I * directory entries. It uses the offset parameter and always$

ERROR: code indent should never use tabs
#572: FILE: tools/virtiofsd/fuse.h:552:
+^I * passes non-zero offset to the filler function. When the buffer$

ERROR: code indent should never use tabs
#573: FILE: tools/virtiofsd/fuse.h:553:
+^I * is full (or an error happens) the filler function will return$

ERROR: code indent should never use tabs
#574: FILE: tools/virtiofsd/fuse.h:554:
+^I * '1'.$

ERROR: code indent should never use tabs
#575: FILE: tools/virtiofsd/fuse.h:555:
+^I */$

ERROR: code indent should never use tabs
#576: FILE: tools/virtiofsd/fuse.h:556:
+^Iint (*readdir) (const char *, void *, fuse_fill_dir_t, off_t,$

ERROR: code indent should never use tabs
#577: FILE: tools/virtiofsd/fuse.h:557:
+^I^I^Istruct fuse_file_info *, enum fuse_readdir_flags);$

ERROR: code indent should never use tabs
#579: FILE: tools/virtiofsd/fuse.h:559:
+^I/** Release directory$

WARNING: Block comments use a leading /* on a separate line #579: FILE: tools/virtiofsd/fuse.h:559:
+ /** Release directory

ERROR: code indent should never use tabs
#580: FILE: tools/virtiofsd/fuse.h:560:
+^I */$

ERROR: code indent should never use tabs
#581: FILE: tools/virtiofsd/fuse.h:561:
+^Iint (*releasedir) (const char *, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#583: FILE: tools/virtiofsd/fuse.h:563:
+^I/** Synchronize directory contents$

WARNING: Block comments use a leading /* on a separate line #583: FILE: tools/virtiofsd/fuse.h:563:
+ /** Synchronize directory contents

ERROR: code indent should never use tabs
#584: FILE: tools/virtiofsd/fuse.h:564:
+^I *$

ERROR: code indent should never use tabs
#585: FILE: tools/virtiofsd/fuse.h:565:
+^I * If the datasync parameter is non-zero, then only the user data$

ERROR: code indent should never use tabs
#586: FILE: tools/virtiofsd/fuse.h:566:
+^I * should be flushed, not the meta data$

ERROR: code indent should never use tabs
#587: FILE: tools/virtiofsd/fuse.h:567:
+^I */$

ERROR: code indent should never use tabs
#588: FILE: tools/virtiofsd/fuse.h:568:
+^Iint (*fsyncdir) (const char *, int, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#590: FILE: tools/virtiofsd/fuse.h:570:
+^I/**$

ERROR: code indent should never use tabs
#591: FILE: tools/virtiofsd/fuse.h:571:
+^I * Initialize filesystem$

ERROR: code indent should never use tabs
#592: FILE: tools/virtiofsd/fuse.h:572:
+^I *$

ERROR: code indent should never use tabs
#593: FILE: tools/virtiofsd/fuse.h:573:
+^I * The return value will passed in the private_data field of$

ERROR: code indent should never use tabs
#594: FILE: tools/virtiofsd/fuse.h:574:
+^I * struct fuse_context to all file operations, and as a$

ERROR: code indent should never use tabs
#595: FILE: tools/virtiofsd/fuse.h:575:
+^I * parameter to the destroy() method. It overrides the initial$

ERROR: code indent should never use tabs #596: FILE: tools/virtiofsd/fuse.h:576:
+^I * value provided to fuse_main() / fuse_new().$

ERROR: code indent should never use tabs
#597: FILE: tools/virtiofsd/fuse.h:577:
+^I */$

ERROR: code indent should never use tabs
#598: FILE: tools/virtiofsd/fuse.h:578:
+^Ivoid *(*init) (struct fuse_conn_info *conn,$

ERROR: code indent should never use tabs
#599: FILE: tools/virtiofsd/fuse.h:579:
+^I^I struct fuse_config *cfg);$

ERROR: code indent should never use tabs
#601: FILE: tools/virtiofsd/fuse.h:581:
+^I/**$

ERROR: code indent should never use tabs
#602: FILE: tools/virtiofsd/fuse.h:582:
+^I * Clean up filesystem$

ERROR: code indent should never use tabs
#603: FILE: tools/virtiofsd/fuse.h:583:
+^I *$

ERROR: code indent should never use tabs
#604: FILE: tools/virtiofsd/fuse.h:584:
+^I * Called on filesystem exit.$

ERROR: code indent should never use tabs
#605: FILE: tools/virtiofsd/fuse.h:585:
+^I */$

ERROR: code indent should never use tabs
#606: FILE: tools/virtiofsd/fuse.h:586:
+^Ivoid (*destroy) (void *private_data);$

ERROR: code indent should never use tabs
#608: FILE: tools/virtiofsd/fuse.h:588:
+^I/**$

ERROR: code indent should never use tabs
#609: FILE: tools/virtiofsd/fuse.h:589:
+^I * Check file access permissions$

ERROR: code indent should never use tabs
#610: FILE: tools/virtiofsd/fuse.h:590:
+^I *$

ERROR: code indent should never use tabs
#611: FILE: tools/virtiofsd/fuse.h:591:
+^I * This will be called for the access() system call. If the$

ERROR: code indent should never use tabs
#612: FILE: tools/virtiofsd/fuse.h:592:
+^I * 'default_permissions' mount option is given, this method is not$

ERROR: code indent should never use tabs
#613: FILE: tools/virtiofsd/fuse.h:593:
+^I * called.$

ERROR: code indent should never use tabs
#614: FILE: tools/virtiofsd/fuse.h:594:
+^I *$

ERROR: code indent should never use tabs
#615: FILE: tools/virtiofsd/fuse.h:595:
+^I * This method is not called under Linux kernel versions 2.4.x$

ERROR: code indent should never use tabs
#616: FILE: tools/virtiofsd/fuse.h:596:
+^I */$

ERROR: code indent should never use tabs
#617: FILE: tools/virtiofsd/fuse.h:597:
+^Iint (*access) (const char *, int);$

ERROR: code indent should never use tabs
#619: FILE: tools/virtiofsd/fuse.h:599:
+^I/**$

ERROR: code indent should never use tabs
#620: FILE: tools/virtiofsd/fuse.h:600:
+^I * Create and open a file$

ERROR: code indent should never use tabs
#621: FILE: tools/virtiofsd/fuse.h:601:
+^I *$

ERROR: code indent should never use tabs
#622: FILE: tools/virtiofsd/fuse.h:602:
+^I * If the file does not exist, first create it with the specified$

ERROR: code indent should never use tabs
#623: FILE: tools/virtiofsd/fuse.h:603:
+^I * mode, and then open it.$

ERROR: code indent should never use tabs
#624: FILE: tools/virtiofsd/fuse.h:604:
+^I *$

ERROR: code indent should never use tabs
#625: FILE: tools/virtiofsd/fuse.h:605:
+^I * If this method is not implemented or under Linux kernel$

ERROR: code indent should never use tabs
#626: FILE: tools/virtiofsd/fuse.h:606:
+^I * versions earlier than 2.6.15, the mknod() and open() methods$

ERROR: code indent should never use tabs
#627: FILE: tools/virtiofsd/fuse.h:607:
+^I * will be called instead.$

ERROR: code indent should never use tabs
#628: FILE: tools/virtiofsd/fuse.h:608:
+^I */$

ERROR: code indent should never use tabs
#629: FILE: tools/virtiofsd/fuse.h:609:
+^Iint (*create) (const char *, mode_t, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#631: FILE: tools/virtiofsd/fuse.h:611:
+^I/**$

ERROR: code indent should never use tabs
#632: FILE: tools/virtiofsd/fuse.h:612:
+^I * Perform POSIX file locking operation$

ERROR: code indent should never use tabs
#633: FILE: tools/virtiofsd/fuse.h:613:
+^I *$

ERROR: code indent should never use tabs
#634: FILE: tools/virtiofsd/fuse.h:614:
+^I * The cmd argument will be either F_GETLK, F_SETLK or F_SETLKW.$

ERROR: code indent should never use tabs
#635: FILE: tools/virtiofsd/fuse.h:615:
+^I *$

ERROR: code indent should never use tabs
#636: FILE: tools/virtiofsd/fuse.h:616:
+^I * For the meaning of fields in 'struct flock' see the man page$

ERROR: code indent should never use tabs
#637: FILE: tools/virtiofsd/fuse.h:617:
+^I * for fcntl(2). The l_whence field will always be set to$

ERROR: code indent should never use tabs
#638: FILE: tools/virtiofsd/fuse.h:618:
+^I * SEEK_SET.$

ERROR: code indent should never use tabs
#639: FILE: tools/virtiofsd/fuse.h:619:
+^I *$

ERROR: code indent should never use tabs
#640: FILE: tools/virtiofsd/fuse.h:620:
+^I * For checking lock ownership, the 'fuse_file_info->owner'$

ERROR: code indent should never use tabs
#641: FILE: tools/virtiofsd/fuse.h:621:
+^I * argument must be used.$

ERROR: code indent should never use tabs
#642: FILE: tools/virtiofsd/fuse.h:622:
+^I *$

ERROR: code indent should never use tabs
#643: FILE: tools/virtiofsd/fuse.h:623:
+^I * For F_GETLK operation, the library will first check currently$

ERROR: code indent should never use tabs
#644: FILE: tools/virtiofsd/fuse.h:624:
+^I * held locks, and if a conflicting lock is found it will return$

ERROR: code indent should never use tabs
#645: FILE: tools/virtiofsd/fuse.h:625:
+^I * information without calling this method.^I This ensures, that$

ERROR: code indent should never use tabs
#646: FILE: tools/virtiofsd/fuse.h:626:
+^I * for local locks the l_pid field is correctly filled in.^IThe$

ERROR: code indent should never use tabs
#647: FILE: tools/virtiofsd/fuse.h:627:
+^I * results may not be accurate in case of race conditions and in$

ERROR: code indent should never use tabs
#648: FILE: tools/virtiofsd/fuse.h:628:
+^I * the presence of hard links, but it's unlikely that an$

ERROR: code indent should never use tabs
#649: FILE: tools/virtiofsd/fuse.h:629:
+^I * application would rely on accurate GETLK results in these$

ERROR: code indent should never use tabs
#650: FILE: tools/virtiofsd/fuse.h:630:
+^I * cases. If a conflicting lock is not found, this method will be$

ERROR: code indent should never use tabs
#651: FILE: tools/virtiofsd/fuse.h:631:
+^I * called, and the filesystem may fill out l_pid by a meaningful$

ERROR: code indent should never use tabs
#652: FILE: tools/virtiofsd/fuse.h:632:
+^I * value, or it may leave this field zero.$

ERROR: code indent should never use tabs
#653: FILE: tools/virtiofsd/fuse.h:633:
+^I *$

ERROR: code indent should never use tabs
#654: FILE: tools/virtiofsd/fuse.h:634:
+^I * For F_SETLK and F_SETLKW the l_pid field will be set to the pid$

ERROR: code indent should never use tabs
#655: FILE: tools/virtiofsd/fuse.h:635:
+^I * of the process performing the locking operation.$

ERROR: code indent should never use tabs
#656: FILE: tools/virtiofsd/fuse.h:636:
+^I *$

ERROR: code indent should never use tabs
#657: FILE: tools/virtiofsd/fuse.h:637:
+^I * Note: if this method is not implemented, the kernel will still$

ERROR: code indent should never use tabs
#658: FILE: tools/virtiofsd/fuse.h:638:
+^I * allow file locking to work locally. Hence it is only$

ERROR: code indent should never use tabs
#659: FILE: tools/virtiofsd/fuse.h:639:
+^I * interesting for network filesystems and similar.$

ERROR: code indent should never use tabs
#660: FILE: tools/virtiofsd/fuse.h:640:
+^I */$

ERROR: code indent should never use tabs
#661: FILE: tools/virtiofsd/fuse.h:641:
+^Iint (*lock) (const char *, struct fuse_file_info *, int cmd,$

ERROR: code indent should never use tabs
#662: FILE: tools/virtiofsd/fuse.h:642:
+^I^I struct flock *);$

ERROR: code indent should never use tabs
#664: FILE: tools/virtiofsd/fuse.h:644:
+^I/**$

ERROR: code indent should never use tabs
#665: FILE: tools/virtiofsd/fuse.h:645:
+^I * Change the access and modification times of a file with$

ERROR: code indent should never use tabs
#666: FILE: tools/virtiofsd/fuse.h:646:
+^I * nanosecond resolution$

ERROR: code indent should never use tabs
#667: FILE: tools/virtiofsd/fuse.h:647:
+^I *$

ERROR: code indent should never use tabs
#668: FILE: tools/virtiofsd/fuse.h:648:
+^I * This supersedes the old utime() interface. New applications$

ERROR: code indent should never use tabs
#669: FILE: tools/virtiofsd/fuse.h:649:
+^I * should use this.$

ERROR: code indent should never use tabs
#670: FILE: tools/virtiofsd/fuse.h:650:
+^I *$

ERROR: code indent should never use tabs
#671: FILE: tools/virtiofsd/fuse.h:651:
+^I * fi will always be NULL if the file is not currenlty open, but$

ERROR: code indent should never use tabs
#672: FILE: tools/virtiofsd/fuse.h:652:
+^I * may also be NULL if the file is open.$

ERROR: code indent should never use tabs
#673: FILE: tools/virtiofsd/fuse.h:653:
+^I *$

ERROR: code indent should never use tabs
#674: FILE: tools/virtiofsd/fuse.h:654:
+^I * See the utimensat(2) man page for details.$

ERROR: code indent should never use tabs
#675: FILE: tools/virtiofsd/fuse.h:655:
+^I */$

ERROR: code indent should never use tabs
#676: FILE: tools/virtiofsd/fuse.h:656:
+^I int (*utimens) (const char *, const struct timespec tv[2],$

ERROR: code indent should never use tabs
#677: FILE: tools/virtiofsd/fuse.h:657:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#679: FILE: tools/virtiofsd/fuse.h:659:
+^I/**$

ERROR: code indent should never use tabs
#680: FILE: tools/virtiofsd/fuse.h:660:
+^I * Map block index within file to block index within device$

ERROR: code indent should never use tabs
#681: FILE: tools/virtiofsd/fuse.h:661:
+^I *$

ERROR: code indent should never use tabs
#682: FILE: tools/virtiofsd/fuse.h:662:
+^I * Note: This makes sense only for block device backed filesystems$

ERROR: code indent should never use tabs
#683: FILE: tools/virtiofsd/fuse.h:663:
+^I * mounted with the 'blkdev' option$

ERROR: code indent should never use tabs
#684: FILE: tools/virtiofsd/fuse.h:664:
+^I */$

ERROR: code indent should never use tabs
#685: FILE: tools/virtiofsd/fuse.h:665:
+^Iint (*bmap) (const char *, size_t blocksize, uint64_t *idx);$

ERROR: code indent should never use tabs
#687: FILE: tools/virtiofsd/fuse.h:667:
+^I/**$

ERROR: code indent should never use tabs
#688: FILE: tools/virtiofsd/fuse.h:668:
+^I * Ioctl$

ERROR: code indent should never use tabs
#689: FILE: tools/virtiofsd/fuse.h:669:
+^I *$

ERROR: code indent should never use tabs
#690: FILE: tools/virtiofsd/fuse.h:670:
+^I * flags will have FUSE_IOCTL_COMPAT set for 32bit ioctls in$

ERROR: code indent should never use tabs
#691: FILE: tools/virtiofsd/fuse.h:671:
+^I * 64bit environment. The size and direction of data is$

ERROR: code indent should never use tabs
#692: FILE: tools/virtiofsd/fuse.h:672:
+^I * determined by _IOC_*() decoding of cmd. For _IOC_NONE,$

ERROR: code indent should never use tabs
#693: FILE: tools/virtiofsd/fuse.h:673:
+^I * data will be NULL, for _IOC_WRITE data is out area, for$

ERROR: code indent should never use tabs
#694: FILE: tools/virtiofsd/fuse.h:674:
+^I * _IOC_READ in area and if both are set in/out area. In all$

ERROR: code indent should never use tabs
#695: FILE: tools/virtiofsd/fuse.h:675:
+^I * non-NULL cases, the area is of _IOC_SIZE(cmd) bytes.$

ERROR: code indent should never use tabs
#696: FILE: tools/virtiofsd/fuse.h:676:
+^I *$

ERROR: code indent should never use tabs
#697: FILE: tools/virtiofsd/fuse.h:677:
+^I * If flags has FUSE_IOCTL_DIR then the fuse_file_info refers to a$

ERROR: code indent should never use tabs
#698: FILE: tools/virtiofsd/fuse.h:678:
+^I * directory file handle.$

ERROR: code indent should never use tabs
#699: FILE: tools/virtiofsd/fuse.h:679:
+^I *$

ERROR: code indent should never use tabs
#700: FILE: tools/virtiofsd/fuse.h:680:
+^I * Note : the unsigned long request submitted by the application$

ERROR: code indent should never use tabs
#701: FILE: tools/virtiofsd/fuse.h:681:
+^I * is truncated to 32 bits.$

ERROR: code indent should never use tabs
#702: FILE: tools/virtiofsd/fuse.h:682:
+^I */$

ERROR: code indent should never use tabs
#703: FILE: tools/virtiofsd/fuse.h:683:
+^Iint (*ioctl) (const char *, unsigned int cmd, void *arg,$

ERROR: code indent should never use tabs
#704: FILE: tools/virtiofsd/fuse.h:684:
+^I^I struct fuse_file_info *, unsigned int flags, void *data);$

ERROR: code indent should never use tabs
#706: FILE: tools/virtiofsd/fuse.h:686:
+^I/**$

ERROR: code indent should never use tabs
#707: FILE: tools/virtiofsd/fuse.h:687:
+^I * Poll for IO readiness events$

ERROR: code indent should never use tabs
#708: FILE: tools/virtiofsd/fuse.h:688:
+^I *$

ERROR: code indent should never use tabs
#709: FILE: tools/virtiofsd/fuse.h:689:
+^I * Note: If ph is non-NULL, the client should notify$

ERROR: code indent should never use tabs
#710: FILE: tools/virtiofsd/fuse.h:690:
+^I * when IO readiness events occur by calling$

ERROR: code indent should never use tabs
#711: FILE: tools/virtiofsd/fuse.h:691:
+^I * fuse_notify_poll() with the specified ph.$

ERROR: code indent should never use tabs
#712: FILE: tools/virtiofsd/fuse.h:692:
+^I *$

ERROR: code indent should never use tabs
#713: FILE: tools/virtiofsd/fuse.h:693:
+^I * Regardless of the number of times poll with a non-NULL ph$

ERROR: code indent should never use tabs
#714: FILE: tools/virtiofsd/fuse.h:694:
+^I * is received, single notification is enough to clear all.$

ERROR: code indent should never use tabs
#715: FILE: tools/virtiofsd/fuse.h:695:
+^I * Notifying more times incurs overhead but doesn't harm$

ERROR: code indent should never use tabs
#716: FILE: tools/virtiofsd/fuse.h:696:
+^I * correctness.$

ERROR: code indent should never use tabs
#717: FILE: tools/virtiofsd/fuse.h:697:
+^I *$

ERROR: code indent should never use tabs
#718: FILE: tools/virtiofsd/fuse.h:698:
+^I * The callee is responsible for destroying ph with$

ERROR: code indent should never use tabs
#719: FILE: tools/virtiofsd/fuse.h:699:
+^I * fuse_pollhandle_destroy() when no longer in use.$

ERROR: code indent should never use tabs
#720: FILE: tools/virtiofsd/fuse.h:700:
+^I */$

ERROR: code indent should never use tabs
#721: FILE: tools/virtiofsd/fuse.h:701:
+^Iint (*poll) (const char *, struct fuse_file_info *,$

ERROR: code indent should never use tabs
#722: FILE: tools/virtiofsd/fuse.h:702:
+^I^I struct fuse_pollhandle *ph, unsigned *reventsp);$

ERROR: code indent should never use tabs
#724: FILE: tools/virtiofsd/fuse.h:704:
+^I/** Write contents of buffer to an open file$

WARNING: Block comments use a leading /* on a separate line #724: FILE: tools/virtiofsd/fuse.h:704:
+ /** Write contents of buffer to an open file

ERROR: code indent should never use tabs
#725: FILE: tools/virtiofsd/fuse.h:705:
+^I *$

ERROR: code indent should never use tabs
#726: FILE: tools/virtiofsd/fuse.h:706:
+^I * Similar to the write() method, but data is supplied in a$

ERROR: code indent should never use tabs
#727: FILE: tools/virtiofsd/fuse.h:707:
+^I * generic buffer. Use fuse_buf_copy() to transfer data to$

ERROR: code indent should never use tabs
#728: FILE: tools/virtiofsd/fuse.h:708:
+^I * the destination.$

ERROR: code indent should never use tabs
#729: FILE: tools/virtiofsd/fuse.h:709:
+^I *$

ERROR: code indent should never use tabs
#730: FILE: tools/virtiofsd/fuse.h:710:
+^I * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is$

ERROR: code indent should never use tabs #731: FILE: tools/virtiofsd/fuse.h:711:
+^I * expected to reset the setuid and setgid bits.$

ERROR: code indent should never use tabs
#732: FILE: tools/virtiofsd/fuse.h:712:
+^I */$

ERROR: code indent should never use tabs
#733: FILE: tools/virtiofsd/fuse.h:713:
+^Iint (*write_buf) (const char *, struct fuse_bufvec *buf, off_t off,$

ERROR: code indent should never use tabs
#734: FILE: tools/virtiofsd/fuse.h:714:
+^I^I^I struct fuse_file_info *);$

ERROR: code indent should never use tabs
#736: FILE: tools/virtiofsd/fuse.h:716:
+^I/** Store data from an open file in a buffer$

WARNING: Block comments use a leading /* on a separate line #736: FILE: tools/virtiofsd/fuse.h:716:
+ /** Store data from an open file in a buffer

ERROR: code indent should never use tabs
#737: FILE: tools/virtiofsd/fuse.h:717:
+^I *$

ERROR: code indent should never use tabs
#738: FILE: tools/virtiofsd/fuse.h:718:
+^I * Similar to the read() method, but data is stored and$

ERROR: code indent should never use tabs
#739: FILE: tools/virtiofsd/fuse.h:719:
+^I * returned in a generic buffer.$

ERROR: code indent should never use tabs
#740: FILE: tools/virtiofsd/fuse.h:720:
+^I *$

ERROR: code indent should never use tabs
#741: FILE: tools/virtiofsd/fuse.h:721:
+^I * No actual copying of data has to take place, the source$

ERROR: code indent should never use tabs
#742: FILE: tools/virtiofsd/fuse.h:722:
+^I * file descriptor may simply be stored in the buffer for$

ERROR: code indent should never use tabs
#743: FILE: tools/virtiofsd/fuse.h:723:
+^I * later data transfer.$

ERROR: code indent should never use tabs
#744: FILE: tools/virtiofsd/fuse.h:724:
+^I *$

ERROR: code indent should never use tabs
#745: FILE: tools/virtiofsd/fuse.h:725:
+^I * The buffer must be allocated dynamically and stored at the$

ERROR: code indent should never use tabs
#746: FILE: tools/virtiofsd/fuse.h:726:
+^I * location pointed to by bufp. If the buffer contains memory$

ERROR: code indent should never use tabs
#747: FILE: tools/virtiofsd/fuse.h:727:
+^I * regions, they too must be allocated using malloc(). The$

ERROR: code indent should never use tabs #748: FILE: tools/virtiofsd/fuse.h:728:
+^I * allocated memory will be freed by the caller.$

ERROR: code indent should never use tabs
#749: FILE: tools/virtiofsd/fuse.h:729:
+^I */$

ERROR: code indent should never use tabs
#750: FILE: tools/virtiofsd/fuse.h:730:
+^Iint (*read_buf) (const char *, struct fuse_bufvec **bufp,$

ERROR: code indent should never use tabs
#751: FILE: tools/virtiofsd/fuse.h:731:
+^I^I^I size_t size, off_t off, struct fuse_file_info *);$

ERROR: code indent should never use tabs
#752: FILE: tools/virtiofsd/fuse.h:732:
+^I/**$

ERROR: code indent should never use tabs
#753: FILE: tools/virtiofsd/fuse.h:733:
+^I * Perform BSD file locking operation$

ERROR: code indent should never use tabs
#754: FILE: tools/virtiofsd/fuse.h:734:
+^I *$

ERROR: code indent should never use tabs
#755: FILE: tools/virtiofsd/fuse.h:735:
+^I * The op argument will be either LOCK_SH, LOCK_EX or LOCK_UN$

ERROR: code indent should never use tabs
#756: FILE: tools/virtiofsd/fuse.h:736:
+^I *$

ERROR: code indent should never use tabs
#757: FILE: tools/virtiofsd/fuse.h:737:
+^I * Nonblocking requests will be indicated by ORing LOCK_NB to$

ERROR: code indent should never use tabs
#758: FILE: tools/virtiofsd/fuse.h:738:
+^I * the above operations$

ERROR: code indent should never use tabs
#759: FILE: tools/virtiofsd/fuse.h:739:
+^I *$

ERROR: code indent should never use tabs
#760: FILE: tools/virtiofsd/fuse.h:740:
+^I * For more information see the flock(2) manual page.$

ERROR: code indent should never use tabs
#761: FILE: tools/virtiofsd/fuse.h:741:
+^I *$

ERROR: code indent should never use tabs
#762: FILE: tools/virtiofsd/fuse.h:742:
+^I * Additionally fi->owner will be set to a value unique to$

ERROR: code indent should never use tabs
#763: FILE: tools/virtiofsd/fuse.h:743:
+^I * this open file. This same value will be supplied to$

ERROR: code indent should never use tabs
#764: FILE: tools/virtiofsd/fuse.h:744:
+^I * ->release() when the file is released.$

ERROR: code indent should never use tabs
#765: FILE: tools/virtiofsd/fuse.h:745:
+^I *$

ERROR: code indent should never use tabs
#766: FILE: tools/virtiofsd/fuse.h:746:
+^I * Note: if this method is not implemented, the kernel will still$

ERROR: code indent should never use tabs
#767: FILE: tools/virtiofsd/fuse.h:747:
+^I * allow file locking to work locally. Hence it is only$

ERROR: code indent should never use tabs
#768: FILE: tools/virtiofsd/fuse.h:748:
+^I * interesting for network filesystems and similar.$

ERROR: code indent should never use tabs
#769: FILE: tools/virtiofsd/fuse.h:749:
+^I */$

ERROR: code indent should never use tabs
#770: FILE: tools/virtiofsd/fuse.h:750:
+^Iint (*flock) (const char *, struct fuse_file_info *, int op);$

ERROR: code indent should never use tabs
#772: FILE: tools/virtiofsd/fuse.h:752:
+^I/**$

ERROR: code indent should never use tabs
#773: FILE: tools/virtiofsd/fuse.h:753:
+^I * Allocates space for an open file$

ERROR: code indent should never use tabs
#774: FILE: tools/virtiofsd/fuse.h:754:
+^I *$

ERROR: code indent should never use tabs
#775: FILE: tools/virtiofsd/fuse.h:755:
+^I * This function ensures that required space is allocated for specified$

ERROR: code indent should never use tabs
#776: FILE: tools/virtiofsd/fuse.h:756:
+^I * file. If this function returns success then any subsequent write$

ERROR: code indent should never use tabs
#777: FILE: tools/virtiofsd/fuse.h:757:
+^I * request to specified range is guaranteed not to fail because of lack$

ERROR: code indent should never use tabs
#778: FILE: tools/virtiofsd/fuse.h:758:
+^I * of space on the file system media.$

ERROR: code indent should never use tabs
#779: FILE: tools/virtiofsd/fuse.h:759:
+^I */$

ERROR: code indent should never use tabs #780: FILE: tools/virtiofsd/fuse.h:760:
+^Iint (*fallocate) (const char *, int, off_t, off_t,$

ERROR: code indent should never use tabs
#781: FILE: tools/virtiofsd/fuse.h:761:
+^I^I^I struct fuse_file_info *);$

ERROR: code indent should never use tabs
#783: FILE: tools/virtiofsd/fuse.h:763:
+^I/**$

ERROR: code indent should never use tabs #784: FILE: tools/virtiofsd/fuse.h:764:
+^I * Copy a range of data from one file to another$

ERROR: code indent should never use tabs
#785: FILE: tools/virtiofsd/fuse.h:765:
+^I *$

ERROR: code indent should never use tabs
#786: FILE: tools/virtiofsd/fuse.h:766:
+^I * Performs an optimized copy between two file descriptors without the$

ERROR: code indent should never use tabs
#787: FILE: tools/virtiofsd/fuse.h:767:
+^I * additional cost of transferring data through the FUSE kernel module$

ERROR: code indent should never use tabs
#788: FILE: tools/virtiofsd/fuse.h:768:
+^I * to user space (glibc) and then back into the FUSE filesystem again.$

ERROR: code indent should never use tabs
#789: FILE: tools/virtiofsd/fuse.h:769:
+^I *$

ERROR: code indent should never use tabs
#790: FILE: tools/virtiofsd/fuse.h:770:
+^I * In case this method is not implemented, glibc falls back to reading$

ERROR: code indent should never use tabs
#791: FILE: tools/virtiofsd/fuse.h:771:
+^I * data from the source and writing to the destination. Effectively$

ERROR: code indent should never use tabs
#792: FILE: tools/virtiofsd/fuse.h:772:
+^I * doing an inefficient copy of the data.$

ERROR: code indent should never use tabs
#793: FILE: tools/virtiofsd/fuse.h:773:
+^I */$

ERROR: code indent should never use tabs #794: FILE: tools/virtiofsd/fuse.h:774:
+^Issize_t (*copy_file_range) (const char *path_in,$

ERROR: code indent should never use tabs
#795: FILE: tools/virtiofsd/fuse.h:775:
+^I^I^I^I struct fuse_file_info *fi_in,$

ERROR: code indent should never use tabs
#796: FILE: tools/virtiofsd/fuse.h:776:
+^I^I^I^I off_t offset_in, const char *path_out,$

ERROR: code indent should never use tabs
#797: FILE: tools/virtiofsd/fuse.h:777:
+^I^I^I^I struct fuse_file_info *fi_out,$

ERROR: code indent should never use tabs
#798: FILE: tools/virtiofsd/fuse.h:778:
+^I^I^I^I off_t offset_out, size_t size, int flags);$

ERROR: code indent should never use tabs
#800: FILE: tools/virtiofsd/fuse.h:780:
+^I/**$

ERROR: code indent should never use tabs
#801: FILE: tools/virtiofsd/fuse.h:781:
+^I * Find next data or hole after the specified offset$

ERROR: code indent should never use tabs
#802: FILE: tools/virtiofsd/fuse.h:782:
+^I */$

WARNING: line over 80 characters
#803: FILE: tools/virtiofsd/fuse.h:783:
+ off_t (*lseek) (const char *, off_t off, int whence, struct fuse_file_info *);

ERROR: code indent should never use tabs
#803: FILE: tools/virtiofsd/fuse.h:783:
+^Ioff_t (*lseek) (const char *, off_t off, int whence, struct fuse_file_info *);$

WARNING: Block comments use a leading /* on a separate line #806: FILE: tools/virtiofsd/fuse.h:786:
+/** Extra context that may be needed by some filesystems

ERROR: code indent should never use tabs
#812: FILE: tools/virtiofsd/fuse.h:792:
+^I/** Pointer to the fuse object */$

ERROR: code indent should never use tabs
#813: FILE: tools/virtiofsd/fuse.h:793:
+^Istruct fuse *fuse;$

ERROR: code indent should never use tabs
#815: FILE: tools/virtiofsd/fuse.h:795:
+^I/** User ID of the calling process */$

ERROR: code indent should never use tabs
#816: FILE: tools/virtiofsd/fuse.h:796:
+^Iuid_t uid;$

ERROR: code indent should never use tabs
#818: FILE: tools/virtiofsd/fuse.h:798:
+^I/** Group ID of the calling process */$

ERROR: code indent should never use tabs
#819: FILE: tools/virtiofsd/fuse.h:799:
+^Igid_t gid;$

ERROR: code indent should never use tabs
#821: FILE: tools/virtiofsd/fuse.h:801:
+^I/** Process ID of the calling thread */$

ERROR: code indent should never use tabs
#822: FILE: tools/virtiofsd/fuse.h:802:
+^Ipid_t pid;$

ERROR: code indent should never use tabs
#824: FILE: tools/virtiofsd/fuse.h:804:
+^I/** Private filesystem data */$

ERROR: code indent should never use tabs
#825: FILE: tools/virtiofsd/fuse.h:805:
+^Ivoid *private_data;$

ERROR: code indent should never use tabs
#827: FILE: tools/virtiofsd/fuse.h:807:
+^I/** Umask of the calling process */$

ERROR: code indent should never use tabs
#828: FILE: tools/virtiofsd/fuse.h:808:
+^Imode_t umask;$

WARNING: Block comments use * on subsequent lines
#886: FILE: tools/virtiofsd/fuse.h:866:
+/*
+ int fuse_main(int argc, char *argv[], const struct fuse_operations *op,

ERROR: code indent should never use tabs
#889: FILE: tools/virtiofsd/fuse.h:869:
+#define fuse_main(argc, argv, op, private_data)^I^I^I^I\$

ERROR: code indent should never use tabs
#890: FILE: tools/virtiofsd/fuse.h:870:
+^Ifuse_main_real(argc, argv, op, sizeof(*(op)), private_data)$

WARNING: Block comments use a leading /* on a separate line #892: FILE: tools/virtiofsd/fuse.h:872:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#893: FILE: tools/virtiofsd/fuse.h:873:
+ * More detailed API^I^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #894: FILE: tools/virtiofsd/fuse.h:874:
+ * ----------------------------------------------------------- */

WARNING: line over 80 characters
#937: FILE: tools/virtiofsd/fuse.h:917:
+struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *op,

ERROR: code indent should never use tabs
#938: FILE: tools/virtiofsd/fuse.h:918:
+^I^I^I size_t op_size, void *private_data);$

ERROR: code indent should never use tabs
#942: FILE: tools/virtiofsd/fuse.h:922:
+^I^I size_t op_size, void *private_data);$

ERROR: code indent should never use tabs
#967: FILE: tools/virtiofsd/fuse.h:947:
+ * NOTE: This function does not unmount the filesystem.^I If this is$

ERROR: code indent should never use tabs
#1095: FILE: tools/virtiofsd/fuse.h:1075:
+^I^I size_t op_size, void *private_data);$

ERROR: code indent should never use tabs
#1146: FILE: tools/virtiofsd/fuse.h:1126:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1148: FILE: tools/virtiofsd/fuse.h:1128:
+^I^I const char *newpath, unsigned int flags);$

ERROR: code indent should never use tabs
#1152: FILE: tools/virtiofsd/fuse.h:1132:
+^I^I const char *path);$

ERROR: code indent should never use tabs
#1154: FILE: tools/virtiofsd/fuse.h:1134:
+int fuse_fs_release(struct fuse_fs *fs,^I const char *path,$

ERROR: code indent should never use tabs
#1155: FILE: tools/virtiofsd/fuse.h:1135:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1157: FILE: tools/virtiofsd/fuse.h:1137:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1159: FILE: tools/virtiofsd/fuse.h:1139:
+^I^I off_t off, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1161: FILE: tools/virtiofsd/fuse.h:1141:
+^I^I struct fuse_bufvec **bufp, size_t size, off_t off,$

ERROR: code indent should never use tabs
#1162: FILE: tools/virtiofsd/fuse.h:1142:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1164: FILE: tools/virtiofsd/fuse.h:1144:
+^I^I size_t size, off_t off, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1166: FILE: tools/virtiofsd/fuse.h:1146:
+^I^I struct fuse_bufvec *buf, off_t off,$

ERROR: code indent should never use tabs
#1167: FILE: tools/virtiofsd/fuse.h:1147:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1169: FILE: tools/virtiofsd/fuse.h:1149:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1171: FILE: tools/virtiofsd/fuse.h:1151:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1174: FILE: tools/virtiofsd/fuse.h:1154:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1176: FILE: tools/virtiofsd/fuse.h:1156:
+^I^I fuse_fill_dir_t filler, off_t off,$

ERROR: code indent should never use tabs
#1177: FILE: tools/virtiofsd/fuse.h:1157:
+^I^I struct fuse_file_info *fi, enum fuse_readdir_flags flags);$

ERROR: code indent should never use tabs
#1179: FILE: tools/virtiofsd/fuse.h:1159:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1181: FILE: tools/virtiofsd/fuse.h:1161:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1183: FILE: tools/virtiofsd/fuse.h:1163:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1185: FILE: tools/virtiofsd/fuse.h:1165:
+^I^I struct fuse_file_info *fi, int cmd, struct flock *lock);$

ERROR: code indent should never use tabs
#1187: FILE: tools/virtiofsd/fuse.h:1167:
+^I^I struct fuse_file_info *fi, int op);$

ERROR: code indent should never use tabs
#1189: FILE: tools/virtiofsd/fuse.h:1169:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1191: FILE: tools/virtiofsd/fuse.h:1171:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1193: FILE: tools/virtiofsd/fuse.h:1173:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1195: FILE: tools/virtiofsd/fuse.h:1175:
+^I^I const struct timespec tv[2], struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1198: FILE: tools/virtiofsd/fuse.h:1178:
+^I^I size_t len);$

ERROR: code indent should never use tabs
#1200: FILE: tools/virtiofsd/fuse.h:1180:
+^I^I dev_t rdev);$

ERROR: code indent should never use tabs
#1203: FILE: tools/virtiofsd/fuse.h:1183:
+^I^I const char *value, size_t size, int flags);$

ERROR: code indent should never use tabs
#1205: FILE: tools/virtiofsd/fuse.h:1185:
+^I^I char *value, size_t size);$

ERROR: code indent should never use tabs
#1207: FILE: tools/virtiofsd/fuse.h:1187:
+^I^I size_t size);$

ERROR: code indent should never use tabs
#1209: FILE: tools/virtiofsd/fuse.h:1189:
+^I^I^Iconst char *name);$

ERROR: code indent should never use tabs
#1211: FILE: tools/virtiofsd/fuse.h:1191:
+^I^I uint64_t *idx);$

ERROR: code indent should never use tabs
#1213: FILE: tools/virtiofsd/fuse.h:1193:
+^I^I void *arg, struct fuse_file_info *fi, unsigned int flags,$

ERROR: code indent should never use tabs
#1214: FILE: tools/virtiofsd/fuse.h:1194:
+^I^I void *data);$

ERROR: code indent should never use tabs
#1216: FILE: tools/virtiofsd/fuse.h:1196:
+^I^I struct fuse_file_info *fi, struct fuse_pollhandle *ph,$

ERROR: code indent should never use tabs
#1217: FILE: tools/virtiofsd/fuse.h:1197:
+^I^I unsigned *reventsp);$

ERROR: code indent should never use tabs
#1219: FILE: tools/virtiofsd/fuse.h:1199:
+^I^I off_t offset, off_t length, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs #1221: FILE: tools/virtiofsd/fuse.h:1201:
+^I^I^I^Istruct fuse_file_info *fi_in, off_t off_in,$

ERROR: code indent should never use tabs
#1222: FILE: tools/virtiofsd/fuse.h:1202:
+^I^I^I^Iconst char *path_out,$

ERROR: code indent should never use tabs #1223: FILE: tools/virtiofsd/fuse.h:1203:
+^I^I^I^Istruct fuse_file_info *fi_out, off_t off_out,$

ERROR: code indent should never use tabs
#1224: FILE: tools/virtiofsd/fuse.h:1204:
+^I^I^I^Isize_t len, int flags);$

ERROR: code indent should never use tabs
#1226: FILE: tools/virtiofsd/fuse.h:1206:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#1228: FILE: tools/virtiofsd/fuse.h:1208:
+^I^Istruct fuse_config *cfg);$

ERROR: code indent should never use tabs
#1247: FILE: tools/virtiofsd/fuse.h:1227:
+^I^I^I void *private_data);$

ERROR: code indent should never use tabs
#1264: FILE: tools/virtiofsd/fuse.h:1244:
+^I^I^I^I^I^I struct fuse_fs *fs[]);$

ERROR: code indent should never use tabs
#1276: FILE: tools/virtiofsd/fuse.h:1256:
+^Ifuse_module_factory_t fuse_module_ ## name_ ## _factory = factory_$

WARNING: architecture specific defines should be avoided #1291: FILE: tools/virtiofsd/fuse.h:1271:
+#ifdef __cplusplus

WARNING: Block comments use a leading /* on a separate line #1302: FILE: tools/virtiofsd/fuse_common.h:1:
+/* FUSE: Filesystem in Userspace

WARNING: Block comments use * on subsequent lines #1303: FILE: tools/virtiofsd/fuse_common.h:2:
+/* FUSE: Filesystem in Userspace
+ Copyright (C) 2001-2007 Miklos Szeredi <[email protected]>

ERROR: line over 90 characters
#1312: FILE: tools/virtiofsd/fuse_common.h:11:
+#error "Never include <fuse_common.h> directly; use <fuse.h> or <fuse_lowlevel.h> instead."

WARNING: architecture specific defines should be avoided #1332: FILE: tools/virtiofsd/fuse_common.h:31:
+#ifdef __cplusplus

ERROR: code indent should never use tabs
#1346: FILE: tools/virtiofsd/fuse_common.h:45:
+^I/** Open flags.^I Available in open() and release() */$

ERROR: code indent should never use tabs
#1347: FILE: tools/virtiofsd/fuse_common.h:46:
+^Iint flags;$

ERROR: code indent should never use tabs
#1349: FILE: tools/virtiofsd/fuse_common.h:48:
+^I/** In case of a write operation indicates if this was caused$

WARNING: Block comments use a leading /* on a separate line #1349: FILE: tools/virtiofsd/fuse_common.h:48:
+ /** In case of a write operation indicates if this was caused

ERROR: code indent should never use tabs
#1350: FILE: tools/virtiofsd/fuse_common.h:49:
+^I by a delayed write from the page cache. If so, then the$

WARNING: Block comments use * on subsequent lines
#1350: FILE: tools/virtiofsd/fuse_common.h:49:
+ /** In case of a write operation indicates if this was caused
+ by a delayed write from the page cache. If so, then the

ERROR: code indent should never use tabs
#1351: FILE: tools/virtiofsd/fuse_common.h:50:
+^I context's pid, uid, and gid fields will not be valid, and$

ERROR: code indent should never use tabs
#1352: FILE: tools/virtiofsd/fuse_common.h:51:
+^I the *fh* value may not match the *fh* value that would$

ERROR: code indent should never use tabs
#1353: FILE: tools/virtiofsd/fuse_common.h:52:
+^I have been sent with the corresponding individual write$

ERROR: code indent should never use tabs
#1354: FILE: tools/virtiofsd/fuse_common.h:53:
+^I requests if write caching had been disabled. */$

WARNING: Block comments use a trailing */ on a separate line #1354: FILE: tools/virtiofsd/fuse_common.h:53:
+ requests if write caching had been disabled. */

ERROR: code indent should never use tabs
#1355: FILE: tools/virtiofsd/fuse_common.h:54:
+^Iunsigned int writepage : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1355: FILE: tools/virtiofsd/fuse_common.h:54:

+       unsigned int writepage : 1;
                               ^

ERROR: code indent should never use tabs
#1357: FILE: tools/virtiofsd/fuse_common.h:56:
+^I/** Can be filled in by open, to use direct I/O on this file. */$

ERROR: code indent should never use tabs
#1358: FILE: tools/virtiofsd/fuse_common.h:57:
+^Iunsigned int direct_io : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1358: FILE: tools/virtiofsd/fuse_common.h:57:

+       unsigned int direct_io : 1;
                               ^

ERROR: code indent should never use tabs
#1360: FILE: tools/virtiofsd/fuse_common.h:59:
+^I/** Can be filled in by open. It signals the kernel that any$

WARNING: Block comments use a leading /* on a separate line #1360: FILE: tools/virtiofsd/fuse_common.h:59:
+ /** Can be filled in by open. It signals the kernel that any

ERROR: code indent should never use tabs
#1361: FILE: tools/virtiofsd/fuse_common.h:60:
+^I currently cached file data (ie., data that the filesystem$

WARNING: Block comments use * on subsequent lines
#1361: FILE: tools/virtiofsd/fuse_common.h:60:
+ /** Can be filled in by open. It signals the kernel that any
+ currently cached file data (ie., data that the filesystem

ERROR: code indent should never use tabs
#1362: FILE: tools/virtiofsd/fuse_common.h:61:
+^I provided the last time the file was open) need not be$

ERROR: code indent should never use tabs
#1363: FILE: tools/virtiofsd/fuse_common.h:62:
+^I invalidated. Has no effect when set in other contexts (in$

ERROR: code indent should never use tabs
#1364: FILE: tools/virtiofsd/fuse_common.h:63:
+^I particular it does nothing when set by opendir()). */$

WARNING: Block comments use a trailing */ on a separate line #1364: FILE: tools/virtiofsd/fuse_common.h:63:
+ particular it does nothing when set by opendir()). */

ERROR: code indent should never use tabs
#1365: FILE: tools/virtiofsd/fuse_common.h:64:
+^Iunsigned int keep_cache : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1365: FILE: tools/virtiofsd/fuse_common.h:64:

+       unsigned int keep_cache : 1;
                                ^

ERROR: code indent should never use tabs
#1367: FILE: tools/virtiofsd/fuse_common.h:66:
+^I/** Indicates a flush operation. Set in flush operation, also$

WARNING: Block comments use a leading /* on a separate line #1367: FILE: tools/virtiofsd/fuse_common.h:66:
+ /** Indicates a flush operation. Set in flush operation, also

ERROR: code indent should never use tabs
#1368: FILE: tools/virtiofsd/fuse_common.h:67:
+^I maybe set in highlevel lock operation and lowlevel release$

WARNING: Block comments use * on subsequent lines
#1368: FILE: tools/virtiofsd/fuse_common.h:67:
+ /** Indicates a flush operation. Set in flush operation, also
+ maybe set in highlevel lock operation and lowlevel release

ERROR: code indent should never use tabs
#1369: FILE: tools/virtiofsd/fuse_common.h:68:
+^I operation. */$

WARNING: Block comments use a trailing */ on a separate line #1369: FILE: tools/virtiofsd/fuse_common.h:68:
+ operation. */

ERROR: code indent should never use tabs
#1370: FILE: tools/virtiofsd/fuse_common.h:69:
+^Iunsigned int flush : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1370: FILE: tools/virtiofsd/fuse_common.h:69:

+       unsigned int flush : 1;
                           ^

ERROR: code indent should never use tabs
#1372: FILE: tools/virtiofsd/fuse_common.h:71:
+^I/** Can be filled in by open, to indicate that the file is not$

WARNING: Block comments use a leading /* on a separate line #1372: FILE: tools/virtiofsd/fuse_common.h:71:
+ /** Can be filled in by open, to indicate that the file is not

ERROR: code indent should never use tabs
#1373: FILE: tools/virtiofsd/fuse_common.h:72:
+^I seekable. */$

WARNING: Block comments use * on subsequent lines
#1373: FILE: tools/virtiofsd/fuse_common.h:72:
+ /** Can be filled in by open, to indicate that the file is not
+ seekable. */

WARNING: Block comments use a trailing */ on a separate line #1373: FILE: tools/virtiofsd/fuse_common.h:72:
+ seekable. */

ERROR: code indent should never use tabs
#1374: FILE: tools/virtiofsd/fuse_common.h:73:
+^Iunsigned int nonseekable : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1374: FILE: tools/virtiofsd/fuse_common.h:73:

+       unsigned int nonseekable : 1;
                                 ^

ERROR: code indent should never use tabs
#1376: FILE: tools/virtiofsd/fuse_common.h:75:
+^I/* Indicates that flock locks for this file should be$

WARNING: Block comments use a leading /* on a separate line #1376: FILE: tools/virtiofsd/fuse_common.h:75:
+ /* Indicates that flock locks for this file should be

ERROR: code indent should never use tabs
#1377: FILE: tools/virtiofsd/fuse_common.h:76:
+^I released. If set, lock_owner shall contain a valid value.$

WARNING: Block comments use * on subsequent lines
#1377: FILE: tools/virtiofsd/fuse_common.h:76:
+ /* Indicates that flock locks for this file should be
+ released. If set, lock_owner shall contain a valid value.

ERROR: code indent should never use tabs
#1378: FILE: tools/virtiofsd/fuse_common.h:77:
+^I May only be set in ->release(). */$

WARNING: Block comments use a trailing */ on a separate line #1378: FILE: tools/virtiofsd/fuse_common.h:77:
+ May only be set in ->release(). */

ERROR: code indent should never use tabs
#1379: FILE: tools/virtiofsd/fuse_common.h:78:
+^Iunsigned int flock_release : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1379: FILE: tools/virtiofsd/fuse_common.h:78:

+       unsigned int flock_release : 1;
                                   ^

ERROR: code indent should never use tabs
#1381: FILE: tools/virtiofsd/fuse_common.h:80:
+^I/** Can be filled in by opendir. It signals the kernel to$

WARNING: Block comments use a leading /* on a separate line #1381: FILE: tools/virtiofsd/fuse_common.h:80:
+ /** Can be filled in by opendir. It signals the kernel to

ERROR: code indent should never use tabs
#1382: FILE: tools/virtiofsd/fuse_common.h:81:
+^I enable caching of entries returned by readdir(). Has no$

WARNING: Block comments use * on subsequent lines
#1382: FILE: tools/virtiofsd/fuse_common.h:81:
+ /** Can be filled in by opendir. It signals the kernel to
+ enable caching of entries returned by readdir(). Has no

ERROR: code indent should never use tabs
#1383: FILE: tools/virtiofsd/fuse_common.h:82:
+^I effect when set in other contexts (in particular it does$

ERROR: code indent should never use tabs
#1384: FILE: tools/virtiofsd/fuse_common.h:83:
+^I nothing when set by open()). */$

WARNING: Block comments use a trailing */ on a separate line #1384: FILE: tools/virtiofsd/fuse_common.h:83:
+ nothing when set by open()). */

ERROR: code indent should never use tabs
#1385: FILE: tools/virtiofsd/fuse_common.h:84:
+^Iunsigned int cache_readdir : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1385: FILE: tools/virtiofsd/fuse_common.h:84:

+       unsigned int cache_readdir : 1;
                                   ^

ERROR: code indent should never use tabs
#1387: FILE: tools/virtiofsd/fuse_common.h:86:
+^I/** Padding. Reserved for future use*/$

ERROR: code indent should never use tabs
#1388: FILE: tools/virtiofsd/fuse_common.h:87:
+^Iunsigned int padding : 25;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1388: FILE: tools/virtiofsd/fuse_common.h:87:

+       unsigned int padding : 25;
                             ^

ERROR: code indent should never use tabs
#1389: FILE: tools/virtiofsd/fuse_common.h:88:
+^Iunsigned int padding2 : 32;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #1389: FILE: tools/virtiofsd/fuse_common.h:88:

+       unsigned int padding2 : 32;
                              ^

ERROR: code indent should never use tabs
#1391: FILE: tools/virtiofsd/fuse_common.h:90:
+^I/** File handle id. May be filled in by filesystem in create,$

WARNING: Block comments use a leading /* on a separate line #1391: FILE: tools/virtiofsd/fuse_common.h:90:
+ /** File handle id. May be filled in by filesystem in create,

ERROR: code indent should never use tabs
#1392: FILE: tools/virtiofsd/fuse_common.h:91:
+^I * open, and opendir(). Available in most other file operations on the$

ERROR: code indent should never use tabs
#1393: FILE: tools/virtiofsd/fuse_common.h:92:
+^I * same file handle. */$

WARNING: Block comments use a trailing */ on a separate line #1393: FILE: tools/virtiofsd/fuse_common.h:92:
+ * same file handle. */

ERROR: code indent should never use tabs
#1394: FILE: tools/virtiofsd/fuse_common.h:93:
+^Iuint64_t fh;$

ERROR: code indent should never use tabs
#1396: FILE: tools/virtiofsd/fuse_common.h:95:
+^I/** Lock owner id. Available in locking operations and flush */$

ERROR: code indent should never use tabs
#1397: FILE: tools/virtiofsd/fuse_common.h:96:
+^Iuint64_t lock_owner;$

ERROR: code indent should never use tabs
#1399: FILE: tools/virtiofsd/fuse_common.h:98:
+^I/** Requested poll events. Available in ->poll. Only set on kernels$

WARNING: Block comments use a leading /* on a separate line #1399: FILE: tools/virtiofsd/fuse_common.h:98:
+ /** Requested poll events. Available in ->poll. Only set on kernels

ERROR: code indent should never use tabs
#1400: FILE: tools/virtiofsd/fuse_common.h:99:
+^I which support it. If unsupported, this field is set to zero. */$

WARNING: Block comments use * on subsequent lines
#1400: FILE: tools/virtiofsd/fuse_common.h:99:
+ /** Requested poll events. Available in ->poll. Only set on kernels
+ which support it. If unsupported, this field is set to zero. */

WARNING: Block comments use a trailing */ on a separate line #1400: FILE: tools/virtiofsd/fuse_common.h:99:
+ which support it. If unsupported, this field is set to zero. */

ERROR: code indent should never use tabs
#1401: FILE: tools/virtiofsd/fuse_common.h:100:
+^Iuint32_t poll_events;$

ERROR: code indent should never use tabs
#1409: FILE: tools/virtiofsd/fuse_common.h:108:
+^I/**$

ERROR: code indent should never use tabs
#1410: FILE: tools/virtiofsd/fuse_common.h:109:
+^I * whether to use separate device fds for each thread$

ERROR: code indent should never use tabs
#1411: FILE: tools/virtiofsd/fuse_common.h:110:
+^I * (may increase performance)$

ERROR: code indent should never use tabs
#1412: FILE: tools/virtiofsd/fuse_common.h:111:
+^I */$

ERROR: code indent should never use tabs
#1413: FILE: tools/virtiofsd/fuse_common.h:112:
+^Iint clone_fd;$

ERROR: code indent should never use tabs
#1415: FILE: tools/virtiofsd/fuse_common.h:114:
+^I/**$

ERROR: code indent should never use tabs
#1416: FILE: tools/virtiofsd/fuse_common.h:115:
+^I * The maximum number of available worker threads before they$

ERROR: code indent should never use tabs
#1417: FILE: tools/virtiofsd/fuse_common.h:116:
+^I * start to get deleted when they become idle. If not$

ERROR: code indent should never use tabs
#1418: FILE: tools/virtiofsd/fuse_common.h:117:
+^I * specified, the default is 10.$

ERROR: code indent should never use tabs
#1419: FILE: tools/virtiofsd/fuse_common.h:118:
+^I *$

ERROR: code indent should never use tabs
#1420: FILE: tools/virtiofsd/fuse_common.h:119:
+^I * Adjusting this has performance implications; a very small number$

ERROR: code indent should never use tabs
#1421: FILE: tools/virtiofsd/fuse_common.h:120:
+^I * of threads in the pool will cause a lot of thread creation and$

ERROR: code indent should never use tabs
#1422: FILE: tools/virtiofsd/fuse_common.h:121:
+^I * deletion overhead and performance may suffer. When set to 0, a new$

ERROR: code indent should never use tabs
#1423: FILE: tools/virtiofsd/fuse_common.h:122:
+^I * thread will be created to service every operation.$

ERROR: code indent should never use tabs
#1424: FILE: tools/virtiofsd/fuse_common.h:123:
+^I */$

ERROR: code indent should never use tabs
#1425: FILE: tools/virtiofsd/fuse_common.h:124:
+^Iunsigned int max_idle_threads;$

WARNING: Block comments use a leading /* on a separate line #1428: FILE: tools/virtiofsd/fuse_common.h:127:
+/**************************************************************************

ERROR: code indent should never use tabs
#1442: FILE: tools/virtiofsd/fuse_common.h:141:
+#define FUSE_CAP_ASYNC_READ^I^I(1 << 0)$

ERROR: code indent should never use tabs
#1450: FILE: tools/virtiofsd/fuse_common.h:149:
+#define FUSE_CAP_POSIX_LOCKS^I^I(1 << 1)$

ERROR: code indent should never use tabs
#1459: FILE: tools/virtiofsd/fuse_common.h:158:
+#define FUSE_CAP_ATOMIC_O_TRUNC^I^I(1 << 3)$

ERROR: code indent should never use tabs
#1466: FILE: tools/virtiofsd/fuse_common.h:165:
+#define FUSE_CAP_EXPORT_SUPPORT^I^I(1 << 4)$

ERROR: code indent should never use tabs
#1474: FILE: tools/virtiofsd/fuse_common.h:173:
+#define FUSE_CAP_DONT_MASK^I^I(1 << 6)$

ERROR: code indent should never use tabs
#1482: FILE: tools/virtiofsd/fuse_common.h:181:
+#define FUSE_CAP_SPLICE_WRITE^I^I(1 << 7)$

ERROR: code indent should never use tabs
#1490: FILE: tools/virtiofsd/fuse_common.h:189:
+#define FUSE_CAP_SPLICE_MOVE^I^I(1 << 8)$

ERROR: code indent should never use tabs
#1499: FILE: tools/virtiofsd/fuse_common.h:198:
+#define FUSE_CAP_SPLICE_READ^I^I(1 << 9)$

ERROR: code indent should never use tabs
#1512: FILE: tools/virtiofsd/fuse_common.h:211:
+#define FUSE_CAP_FLOCK_LOCKS^I^I(1 << 10)$

ERROR: code indent should never use tabs
#1519: FILE: tools/virtiofsd/fuse_common.h:218:
+#define FUSE_CAP_IOCTL_DIR^I^I(1 << 11)$

ERROR: code indent should never use tabs
#1541: FILE: tools/virtiofsd/fuse_common.h:240:
+#define FUSE_CAP_AUTO_INVAL_DATA^I(1 << 12)$

ERROR: code indent should never use tabs
#1549: FILE: tools/virtiofsd/fuse_common.h:248:
+#define FUSE_CAP_READDIRPLUS^I^I(1 << 13)$

ERROR: code indent should never use tabs
#1577: FILE: tools/virtiofsd/fuse_common.h:276:
+#define FUSE_CAP_READDIRPLUS_AUTO^I(1 << 14)$

ERROR: code indent should never use tabs
#1588: FILE: tools/virtiofsd/fuse_common.h:287:
+#define FUSE_CAP_ASYNC_DIO^I^I(1 << 15)$

ERROR: code indent should never use tabs
#1597: FILE: tools/virtiofsd/fuse_common.h:296:
+#define FUSE_CAP_WRITEBACK_CACHE^I(1 << 16)$

ERROR: code indent should never use tabs
#1610: FILE: tools/virtiofsd/fuse_common.h:309:
+#define FUSE_CAP_NO_OPEN_SUPPORT^I(1 << 17)$

ERROR: code indent should never use tabs
#1672: FILE: tools/virtiofsd/fuse_common.h:371:
+#define FUSE_IOCTL_COMPAT^I(1 << 0)$

ERROR: code indent should never use tabs
#1673: FILE: tools/virtiofsd/fuse_common.h:372:
+#define FUSE_IOCTL_UNRESTRICTED^I(1 << 1)$

ERROR: code indent should never use tabs
#1674: FILE: tools/virtiofsd/fuse_common.h:373:
+#define FUSE_IOCTL_RETRY^I(1 << 2)$

ERROR: code indent should never use tabs
#1675: FILE: tools/virtiofsd/fuse_common.h:374:
+#define FUSE_IOCTL_DIR^I^I(1 << 4)$

ERROR: code indent should never use tabs
#1677: FILE: tools/virtiofsd/fuse_common.h:376:
+#define FUSE_IOCTL_MAX_IOV^I256$

ERROR: code indent should never use tabs
#1687: FILE: tools/virtiofsd/fuse_common.h:386:
+^I/**$

ERROR: code indent should never use tabs
#1688: FILE: tools/virtiofsd/fuse_common.h:387:
+^I * Major version of the protocol (read-only)$

ERROR: code indent should never use tabs
#1689: FILE: tools/virtiofsd/fuse_common.h:388:
+^I */$

ERROR: code indent should never use tabs
#1690: FILE: tools/virtiofsd/fuse_common.h:389:
+^Iunsigned proto_major;$

ERROR: code indent should never use tabs
#1692: FILE: tools/virtiofsd/fuse_common.h:391:
+^I/**$

ERROR: code indent should never use tabs
#1693: FILE: tools/virtiofsd/fuse_common.h:392:
+^I * Minor version of the protocol (read-only)$

ERROR: code indent should never use tabs
#1694: FILE: tools/virtiofsd/fuse_common.h:393:
+^I */$

ERROR: code indent should never use tabs
#1695: FILE: tools/virtiofsd/fuse_common.h:394:
+^Iunsigned proto_minor;$

ERROR: code indent should never use tabs
#1697: FILE: tools/virtiofsd/fuse_common.h:396:
+^I/**$

ERROR: code indent should never use tabs
#1698: FILE: tools/virtiofsd/fuse_common.h:397:
+^I * Maximum size of the write buffer$

ERROR: code indent should never use tabs
#1699: FILE: tools/virtiofsd/fuse_common.h:398:
+^I */$

ERROR: code indent should never use tabs
#1700: FILE: tools/virtiofsd/fuse_common.h:399:
+^Iunsigned max_write;$

ERROR: code indent should never use tabs
#1702: FILE: tools/virtiofsd/fuse_common.h:401:
+^I/**$

ERROR: code indent should never use tabs
#1703: FILE: tools/virtiofsd/fuse_common.h:402:
+^I * Maximum size of read requests. A value of zero indicates no$

ERROR: code indent should never use tabs
#1704: FILE: tools/virtiofsd/fuse_common.h:403:
+^I * limit. However, even if the filesystem does not specify a$

ERROR: code indent should never use tabs
#1705: FILE: tools/virtiofsd/fuse_common.h:404:
+^I * limit, the maximum size of read requests will still be$

ERROR: code indent should never use tabs
#1706: FILE: tools/virtiofsd/fuse_common.h:405:
+^I * limited by the kernel.$

ERROR: code indent should never use tabs
#1707: FILE: tools/virtiofsd/fuse_common.h:406:
+^I *$

ERROR: code indent should never use tabs
#1708: FILE: tools/virtiofsd/fuse_common.h:407:
+^I * NOTE: For the time being, the maximum size of read requests$

ERROR: code indent should never use tabs
#1709: FILE: tools/virtiofsd/fuse_common.h:408:
+^I * must be set both here *and* passed to fuse_session_new()$

ERROR: code indent should never use tabs
#1710: FILE: tools/virtiofsd/fuse_common.h:409:
+^I * using the ``-o max_read=<n>`` mount option. At some point$

ERROR: code indent should never use tabs
#1711: FILE: tools/virtiofsd/fuse_common.h:410:
+^I * in the future, specifying the mount option will no longer$

ERROR: code indent should never use tabs
#1712: FILE: tools/virtiofsd/fuse_common.h:411:
+^I * be necessary.$

ERROR: code indent should never use tabs
#1713: FILE: tools/virtiofsd/fuse_common.h:412:
+^I */$

ERROR: code indent should never use tabs
#1714: FILE: tools/virtiofsd/fuse_common.h:413:
+^Iunsigned max_read;$

ERROR: code indent should never use tabs
#1716: FILE: tools/virtiofsd/fuse_common.h:415:
+^I/**$

ERROR: code indent should never use tabs
#1717: FILE: tools/virtiofsd/fuse_common.h:416:
+^I * Maximum readahead$

ERROR: code indent should never use tabs
#1718: FILE: tools/virtiofsd/fuse_common.h:417:
+^I */$

ERROR: code indent should never use tabs
#1719: FILE: tools/virtiofsd/fuse_common.h:418:
+^Iunsigned max_readahead;$

ERROR: code indent should never use tabs
#1721: FILE: tools/virtiofsd/fuse_common.h:420:
+^I/**$

ERROR: code indent should never use tabs
#1722: FILE: tools/virtiofsd/fuse_common.h:421:
+^I * Capability flags that the kernel supports (read-only)$

ERROR: code indent should never use tabs
#1723: FILE: tools/virtiofsd/fuse_common.h:422:
+^I */$

ERROR: code indent should never use tabs
#1724: FILE: tools/virtiofsd/fuse_common.h:423:
+^Iunsigned capable;$

ERROR: code indent should never use tabs
#1726: FILE: tools/virtiofsd/fuse_common.h:425:
+^I/**$

ERROR: code indent should never use tabs
#1727: FILE: tools/virtiofsd/fuse_common.h:426:
+^I * Capability flags that the filesystem wants to enable.$

ERROR: code indent should never use tabs
#1728: FILE: tools/virtiofsd/fuse_common.h:427:
+^I *$

ERROR: code indent should never use tabs #1729: FILE: tools/virtiofsd/fuse_common.h:428:
+^I * libfuse attempts to initialize this field with$

ERROR: code indent should never use tabs
#1730: FILE: tools/virtiofsd/fuse_common.h:429:
+^I * reasonable default values before calling the init() handler.$

ERROR: code indent should never use tabs
#1731: FILE: tools/virtiofsd/fuse_common.h:430:
+^I */$

ERROR: code indent should never use tabs
#1732: FILE: tools/virtiofsd/fuse_common.h:431:
+^Iunsigned want;$

ERROR: code indent should never use tabs
#1734: FILE: tools/virtiofsd/fuse_common.h:433:
+^I/**$

ERROR: code indent should never use tabs
#1735: FILE: tools/virtiofsd/fuse_common.h:434:
+^I * Maximum number of pending "background" requests. A$

ERROR: code indent should never use tabs
#1736: FILE: tools/virtiofsd/fuse_common.h:435:
+^I * background request is any type of request for which the$

ERROR: code indent should never use tabs
#1737: FILE: tools/virtiofsd/fuse_common.h:436:
+^I * total number is not limited by other means. As of kernel$

ERROR: code indent should never use tabs
#1738: FILE: tools/virtiofsd/fuse_common.h:437:
+^I * 4.8, only two types of requests fall into this category:$

ERROR: code indent should never use tabs
#1739: FILE: tools/virtiofsd/fuse_common.h:438:
+^I *$

ERROR: code indent should never use tabs
#1740: FILE: tools/virtiofsd/fuse_common.h:439:
+^I * 1. Read-ahead requests$

ERROR: code indent should never use tabs
#1741: FILE: tools/virtiofsd/fuse_common.h:440:
+^I * 2. Asynchronous direct I/O requests$

ERROR: code indent should never use tabs
#1742: FILE: tools/virtiofsd/fuse_common.h:441:
+^I *$

ERROR: code indent should never use tabs
#1743: FILE: tools/virtiofsd/fuse_common.h:442:
+^I * Read-ahead requests are generated (if max_readahead is$

ERROR: code indent should never use tabs
#1744: FILE: tools/virtiofsd/fuse_common.h:443:
+^I * non-zero) by the kernel to preemptively fill its caches$

ERROR: code indent should never use tabs
#1745: FILE: tools/virtiofsd/fuse_common.h:444:
+^I * when it anticipates that userspace will soon read more$

ERROR: code indent should never use tabs
#1746: FILE: tools/virtiofsd/fuse_common.h:445:
+^I * data.$

ERROR: code indent should never use tabs
#1747: FILE: tools/virtiofsd/fuse_common.h:446:
+^I *$

ERROR: code indent should never use tabs
#1748: FILE: tools/virtiofsd/fuse_common.h:447:
+^I * Asynchronous direct I/O requests are generated if$

ERROR: code indent should never use tabs
#1749: FILE: tools/virtiofsd/fuse_common.h:448:
+^I * FUSE_CAP_ASYNC_DIO is enabled and userspace submits a large$

ERROR: code indent should never use tabs
#1750: FILE: tools/virtiofsd/fuse_common.h:449:
+^I * direct I/O request. In this case the kernel will internally$

ERROR: code indent should never use tabs
#1751: FILE: tools/virtiofsd/fuse_common.h:450:
+^I * split it up into multiple smaller requests and submit them$

ERROR: code indent should never use tabs
#1752: FILE: tools/virtiofsd/fuse_common.h:451:
+^I * to the filesystem concurrently.$

ERROR: code indent should never use tabs
#1753: FILE: tools/virtiofsd/fuse_common.h:452:
+^I *$

ERROR: code indent should never use tabs
#1754: FILE: tools/virtiofsd/fuse_common.h:453:
+^I * Note that the following requests are *not* background$

ERROR: code indent should never use tabs
#1755: FILE: tools/virtiofsd/fuse_common.h:454:
+^I * requests: writeback requests (limited by the kernel's$

ERROR: code indent should never use tabs
#1756: FILE: tools/virtiofsd/fuse_common.h:455:
+^I * flusher algorithm), regular (i.e., synchronous and$

ERROR: code indent should never use tabs
#1757: FILE: tools/virtiofsd/fuse_common.h:456:
+^I * buffered) userspace read/write requests (limited to one per$

ERROR: code indent should never use tabs
#1758: FILE: tools/virtiofsd/fuse_common.h:457:
+^I * thread), asynchronous read requests (Linux's io_submit(2)$

ERROR: code indent should never use tabs
#1759: FILE: tools/virtiofsd/fuse_common.h:458:
+^I * call actually blocks, so these are also limited to one per$

ERROR: code indent should never use tabs
#1760: FILE: tools/virtiofsd/fuse_common.h:459:
+^I * thread).$

ERROR: code indent should never use tabs
#1761: FILE: tools/virtiofsd/fuse_common.h:460:
+^I */$

ERROR: code indent should never use tabs
#1762: FILE: tools/virtiofsd/fuse_common.h:461:
+^Iunsigned max_background;$

ERROR: code indent should never use tabs
#1764: FILE: tools/virtiofsd/fuse_common.h:463:
+^I/**$

ERROR: code indent should never use tabs
#1765: FILE: tools/virtiofsd/fuse_common.h:464:
+^I * Kernel congestion threshold parameter. If the number of pending$

ERROR: code indent should never use tabs
#1766: FILE: tools/virtiofsd/fuse_common.h:465:
+^I * background requests exceeds this number, the FUSE kernel module will$

ERROR: code indent should never use tabs
#1767: FILE: tools/virtiofsd/fuse_common.h:466:
+^I * mark the filesystem as "congested". This instructs the kernel to$

ERROR: code indent should never use tabs
#1768: FILE: tools/virtiofsd/fuse_common.h:467:
+^I * expect that queued requests will take some time to complete, and to$

ERROR: code indent should never use tabs
#1769: FILE: tools/virtiofsd/fuse_common.h:468:
+^I * adjust its algorithms accordingly (e.g. by putting a waiting thread$

ERROR: code indent should never use tabs
#1770: FILE: tools/virtiofsd/fuse_common.h:469:
+^I * to sleep instead of using a busy-loop).$

ERROR: code indent should never use tabs
#1771: FILE: tools/virtiofsd/fuse_common.h:470:
+^I */$

ERROR: code indent should never use tabs
#1772: FILE: tools/virtiofsd/fuse_common.h:471:
+^Iunsigned congestion_threshold;$

ERROR: code indent should never use tabs
#1774: FILE: tools/virtiofsd/fuse_common.h:473:
+^I/**$

ERROR: code indent should never use tabs
#1775: FILE: tools/virtiofsd/fuse_common.h:474:
+^I * When FUSE_CAP_WRITEBACK_CACHE is enabled, the kernel is responsible$

ERROR: code indent should never use tabs
#1776: FILE: tools/virtiofsd/fuse_common.h:475:
+^I * for updating mtime and ctime when write requests are received. The$

ERROR: code indent should never use tabs
#1777: FILE: tools/virtiofsd/fuse_common.h:476:
+^I * updated values are passed to the filesystem with setattr() requests.$

ERROR: code indent should never use tabs
#1778: FILE: tools/virtiofsd/fuse_common.h:477:
+^I * However, if the filesystem does not support the full resolution of$

ERROR: code indent should never use tabs
#1779: FILE: tools/virtiofsd/fuse_common.h:478:
+^I * the kernel timestamps (nanoseconds), the mtime and ctime values used$

ERROR: code indent should never use tabs
#1780: FILE: tools/virtiofsd/fuse_common.h:479:
+^I * by kernel and filesystem will differ (and result in an apparent$

ERROR: code indent should never use tabs
#1781: FILE: tools/virtiofsd/fuse_common.h:480:
+^I * change of times after a cache flush).$

ERROR: code indent should never use tabs
#1782: FILE: tools/virtiofsd/fuse_common.h:481:
+^I *$

ERROR: code indent should never use tabs
#1783: FILE: tools/virtiofsd/fuse_common.h:482:
+^I * To prevent this problem, this variable can be used to inform the$

ERROR: code indent should never use tabs
#1784: FILE: tools/virtiofsd/fuse_common.h:483:
+^I * kernel about the timestamp granularity supported by the file-system.$

ERROR: code indent should never use tabs
#1785: FILE: tools/virtiofsd/fuse_common.h:484:
+^I * The value should be power of 10. The default is 1, i.e. full$

ERROR: code indent should never use tabs
#1786: FILE: tools/virtiofsd/fuse_common.h:485:
+^I * nano-second resolution. Filesystems supporting only second resolution$

ERROR: code indent should never use tabs
#1787: FILE: tools/virtiofsd/fuse_common.h:486:
+^I * should set this to 1000000000.$

ERROR: code indent should never use tabs
#1788: FILE: tools/virtiofsd/fuse_common.h:487:
+^I */$

ERROR: code indent should never use tabs
#1789: FILE: tools/virtiofsd/fuse_common.h:488:
+^Iunsigned time_gran;$

ERROR: code indent should never use tabs
#1791: FILE: tools/virtiofsd/fuse_common.h:490:
+^I/**$

ERROR: code indent should never use tabs
#1792: FILE: tools/virtiofsd/fuse_common.h:491:
+^I * For future use.$

ERROR: code indent should never use tabs
#1793: FILE: tools/virtiofsd/fuse_common.h:492:
+^I */$

ERROR: code indent should never use tabs
#1794: FILE: tools/virtiofsd/fuse_common.h:493:
+^Iunsigned reserved[22];$

WARNING: line over 80 characters
#1821: FILE: tools/virtiofsd/fuse_common.h:520:
+ * -o no_remote_lock Equivalent to -o no_remote_flock,no_remote_posix_lock

ERROR: "foo* bar" should be "foo *bar"
#1843: FILE: tools/virtiofsd/fuse_common.h:542:
+struct fuse_conn_info_opts* fuse_parse_conn_info_opts(struct fuse_args *args);

ERROR: code indent should never use tabs
#1853: FILE: tools/virtiofsd/fuse_common.h:552:
+^I^I^I struct fuse_conn_info *conn);$

WARNING: Block comments use a leading /* on a separate line #1884: FILE: tools/virtiofsd/fuse_common.h:583:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#1885: FILE: tools/virtiofsd/fuse_common.h:584:
+ * Data buffer^I^I^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #1886: FILE: tools/virtiofsd/fuse_common.h:585:
+ * ----------------------------------------------------------- */

ERROR: code indent should never use tabs
#1892: FILE: tools/virtiofsd/fuse_common.h:591:
+^I/**$

ERROR: code indent should never use tabs
#1893: FILE: tools/virtiofsd/fuse_common.h:592:
+^I * Buffer contains a file descriptor$

ERROR: code indent should never use tabs
#1894: FILE: tools/virtiofsd/fuse_common.h:593:
+^I *$

ERROR: code indent should never use tabs
#1895: FILE: tools/virtiofsd/fuse_common.h:594:
+^I * If this flag is set, the .fd field is valid, otherwise the$

ERROR: code indent should never use tabs
#1896: FILE: tools/virtiofsd/fuse_common.h:595:
+^I * .mem fields is valid.$

ERROR: code indent should never use tabs
#1897: FILE: tools/virtiofsd/fuse_common.h:596:
+^I */$

ERROR: code indent should never use tabs
#1898: FILE: tools/virtiofsd/fuse_common.h:597:
+^IFUSE_BUF_IS_FD^I^I= (1 << 1),$

ERROR: code indent should never use tabs
#1900: FILE: tools/virtiofsd/fuse_common.h:599:
+^I/**$

ERROR: code indent should never use tabs
#1901: FILE: tools/virtiofsd/fuse_common.h:600:
+^I * Seek on the file descriptor$

ERROR: code indent should never use tabs
#1902: FILE: tools/virtiofsd/fuse_common.h:601:
+^I *$

ERROR: code indent should never use tabs
#1903: FILE: tools/virtiofsd/fuse_common.h:602:
+^I * If this flag is set then the .pos field is valid and is$

ERROR: code indent should never use tabs
#1904: FILE: tools/virtiofsd/fuse_common.h:603:
+^I * used to seek to the given offset before performing$

ERROR: code indent should never use tabs
#1905: FILE: tools/virtiofsd/fuse_common.h:604:
+^I * operation on file descriptor.$

ERROR: code indent should never use tabs
#1906: FILE: tools/virtiofsd/fuse_common.h:605:
+^I */$

ERROR: code indent should never use tabs
#1907: FILE: tools/virtiofsd/fuse_common.h:606:
+^IFUSE_BUF_FD_SEEK^I= (1 << 2),$

ERROR: code indent should never use tabs
#1909: FILE: tools/virtiofsd/fuse_common.h:608:
+^I/**$

ERROR: code indent should never use tabs
#1910: FILE: tools/virtiofsd/fuse_common.h:609:
+^I * Retry operation on file descriptor$

ERROR: code indent should never use tabs
#1911: FILE: tools/virtiofsd/fuse_common.h:610:
+^I *$

ERROR: code indent should never use tabs
#1912: FILE: tools/virtiofsd/fuse_common.h:611:
+^I * If this flag is set then retry operation on file descriptor$

ERROR: code indent should never use tabs
#1913: FILE: tools/virtiofsd/fuse_common.h:612:
+^I * until .size bytes have been copied or an error or EOF is$

ERROR: code indent should never use tabs
#1914: FILE: tools/virtiofsd/fuse_common.h:613:
+^I * detected.$

ERROR: code indent should never use tabs
#1915: FILE: tools/virtiofsd/fuse_common.h:614:
+^I */$

ERROR: code indent should never use tabs
#1916: FILE: tools/virtiofsd/fuse_common.h:615:
+^IFUSE_BUF_FD_RETRY^I= (1 << 3),$

ERROR: code indent should never use tabs
#1923: FILE: tools/virtiofsd/fuse_common.h:622:
+^I/**$

ERROR: code indent should never use tabs
#1924: FILE: tools/virtiofsd/fuse_common.h:623:
+^I * Don't use splice(2)$

ERROR: code indent should never use tabs
#1925: FILE: tools/virtiofsd/fuse_common.h:624:
+^I *$

ERROR: code indent should never use tabs
#1926: FILE: tools/virtiofsd/fuse_common.h:625:
+^I * Always fall back to using read and write instead of$

ERROR: code indent should never use tabs
#1927: FILE: tools/virtiofsd/fuse_common.h:626:
+^I * splice(2) to copy data from one file descriptor to another.$

ERROR: code indent should never use tabs
#1928: FILE: tools/virtiofsd/fuse_common.h:627:
+^I *$

ERROR: code indent should never use tabs
#1929: FILE: tools/virtiofsd/fuse_common.h:628:
+^I * If this flag is not set, then only fall back if splice is$

ERROR: code indent should never use tabs
#1930: FILE: tools/virtiofsd/fuse_common.h:629:
+^I * unavailable.$

ERROR: code indent should never use tabs
#1931: FILE: tools/virtiofsd/fuse_common.h:630:
+^I */$

ERROR: code indent should never use tabs
#1932: FILE: tools/virtiofsd/fuse_common.h:631:
+^IFUSE_BUF_NO_SPLICE^I= (1 << 1),$

ERROR: code indent should never use tabs
#1934: FILE: tools/virtiofsd/fuse_common.h:633:
+^I/**$

ERROR: code indent should never use tabs
#1935: FILE: tools/virtiofsd/fuse_common.h:634:
+^I * Force splice$

ERROR: code indent should never use tabs
#1936: FILE: tools/virtiofsd/fuse_common.h:635:
+^I *$

ERROR: code indent should never use tabs
#1937: FILE: tools/virtiofsd/fuse_common.h:636:
+^I * Always use splice(2) to copy data from one file descriptor$

ERROR: code indent should never use tabs
#1938: FILE: tools/virtiofsd/fuse_common.h:637:
+^I * to another. If splice is not available, return -EINVAL.$

ERROR: code indent should never use tabs
#1939: FILE: tools/virtiofsd/fuse_common.h:638:
+^I */$

ERROR: code indent should never use tabs
#1940: FILE: tools/virtiofsd/fuse_common.h:639:
+^IFUSE_BUF_FORCE_SPLICE^I= (1 << 2),$

ERROR: code indent should never use tabs
#1942: FILE: tools/virtiofsd/fuse_common.h:641:
+^I/**$

ERROR: code indent should never use tabs
#1943: FILE: tools/virtiofsd/fuse_common.h:642:
+^I * Try to move data with splice.$

ERROR: code indent should never use tabs
#1944: FILE: tools/virtiofsd/fuse_common.h:643:
+^I *$

ERROR: code indent should never use tabs
#1945: FILE: tools/virtiofsd/fuse_common.h:644:
+^I * If splice is used, try to move pages from the source to the$

ERROR: code indent should never use tabs
#1946: FILE: tools/virtiofsd/fuse_common.h:645:
+^I * destination instead of copying. See documentation of$

ERROR: code indent should never use tabs
#1947: FILE: tools/virtiofsd/fuse_common.h:646:
+^I * SPLICE_F_MOVE in splice(2) man page.$

ERROR: code indent should never use tabs
#1948: FILE: tools/virtiofsd/fuse_common.h:647:
+^I */$

ERROR: code indent should never use tabs
#1949: FILE: tools/virtiofsd/fuse_common.h:648:
+^IFUSE_BUF_SPLICE_MOVE^I= (1 << 3),$

ERROR: code indent should never use tabs
#1951: FILE: tools/virtiofsd/fuse_common.h:650:
+^I/**$

ERROR: code indent should never use tabs
#1952: FILE: tools/virtiofsd/fuse_common.h:651:
+^I * Don't block on the pipe when copying data with splice$

ERROR: code indent should never use tabs
#1953: FILE: tools/virtiofsd/fuse_common.h:652:
+^I *$

ERROR: code indent should never use tabs
#1954: FILE: tools/virtiofsd/fuse_common.h:653:
+^I * Makes the operations on the pipe non-blocking (if the pipe$

ERROR: code indent should never use tabs
#1955: FILE: tools/virtiofsd/fuse_common.h:654:
+^I * is full or empty). See SPLICE_F_NONBLOCK in the splice(2)$

ERROR: code indent should never use tabs
#1956: FILE: tools/virtiofsd/fuse_common.h:655:
+^I * man page.$

ERROR: code indent should never use tabs
#1957: FILE: tools/virtiofsd/fuse_common.h:656:
+^I */$

ERROR: code indent should never use tabs
#1958: FILE: tools/virtiofsd/fuse_common.h:657:
+^IFUSE_BUF_SPLICE_NONBLOCK= (1 << 4),$

ERROR: spaces required around that '=' (ctx:VxW)
#1958: FILE: tools/virtiofsd/fuse_common.h:657:
+ FUSE_BUF_SPLICE_NONBLOCK= (1 << 4),

                                ^

ERROR: code indent should never use tabs
#1968: FILE: tools/virtiofsd/fuse_common.h:667:
+^I/**$

ERROR: code indent should never use tabs
#1969: FILE: tools/virtiofsd/fuse_common.h:668:
+^I * Size of data in bytes$

ERROR: code indent should never use tabs
#1970: FILE: tools/virtiofsd/fuse_common.h:669:
+^I */$

ERROR: code indent should never use tabs
#1971: FILE: tools/virtiofsd/fuse_common.h:670:
+^Isize_t size;$

ERROR: code indent should never use tabs
#1973: FILE: tools/virtiofsd/fuse_common.h:672:
+^I/**$

ERROR: code indent should never use tabs
#1974: FILE: tools/virtiofsd/fuse_common.h:673:
+^I * Buffer flags$

ERROR: code indent should never use tabs
#1975: FILE: tools/virtiofsd/fuse_common.h:674:
+^I */$

ERROR: code indent should never use tabs
#1976: FILE: tools/virtiofsd/fuse_common.h:675:
+^Ienum fuse_buf_flags flags;$

ERROR: code indent should never use tabs
#1978: FILE: tools/virtiofsd/fuse_common.h:677:
+^I/**$

ERROR: code indent should never use tabs
#1979: FILE: tools/virtiofsd/fuse_common.h:678:
+^I * Memory pointer$

ERROR: code indent should never use tabs
#1980: FILE: tools/virtiofsd/fuse_common.h:679:
+^I *$

ERROR: code indent should never use tabs
#1981: FILE: tools/virtiofsd/fuse_common.h:680:
+^I * Used unless FUSE_BUF_IS_FD flag is set.$

ERROR: code indent should never use tabs
#1982: FILE: tools/virtiofsd/fuse_common.h:681:
+^I */$

ERROR: code indent should never use tabs
#1983: FILE: tools/virtiofsd/fuse_common.h:682:
+^Ivoid *mem;$

ERROR: code indent should never use tabs
#1985: FILE: tools/virtiofsd/fuse_common.h:684:
+^I/**$

ERROR: code indent should never use tabs
#1986: FILE: tools/virtiofsd/fuse_common.h:685:
+^I * File descriptor$

ERROR: code indent should never use tabs
#1987: FILE: tools/virtiofsd/fuse_common.h:686:
+^I *$

ERROR: code indent should never use tabs
#1988: FILE: tools/virtiofsd/fuse_common.h:687:
+^I * Used if FUSE_BUF_IS_FD flag is set.$

ERROR: code indent should never use tabs
#1989: FILE: tools/virtiofsd/fuse_common.h:688:
+^I */$

ERROR: code indent should never use tabs
#1990: FILE: tools/virtiofsd/fuse_common.h:689:
+^Iint fd;$

ERROR: code indent should never use tabs
#1992: FILE: tools/virtiofsd/fuse_common.h:691:
+^I/**$

ERROR: code indent should never use tabs
#1993: FILE: tools/virtiofsd/fuse_common.h:692:
+^I * File position$

ERROR: code indent should never use tabs
#1994: FILE: tools/virtiofsd/fuse_common.h:693:
+^I *$

ERROR: code indent should never use tabs
#1995: FILE: tools/virtiofsd/fuse_common.h:694:
+^I * Used if FUSE_BUF_FD_SEEK flag is set.$

ERROR: code indent should never use tabs
#1996: FILE: tools/virtiofsd/fuse_common.h:695:
+^I */$

ERROR: code indent should never use tabs
#1997: FILE: tools/virtiofsd/fuse_common.h:696:
+^Ioff_t pos;$

ERROR: code indent should never use tabs
#2009: FILE: tools/virtiofsd/fuse_common.h:708:
+^I/**$

ERROR: code indent should never use tabs
#2010: FILE: tools/virtiofsd/fuse_common.h:709:
+^I * Number of buffers in the array$

ERROR: code indent should never use tabs
#2011: FILE: tools/virtiofsd/fuse_common.h:710:
+^I */$

ERROR: code indent should never use tabs
#2012: FILE: tools/virtiofsd/fuse_common.h:711:
+^Isize_t count;$

ERROR: code indent should never use tabs
#2014: FILE: tools/virtiofsd/fuse_common.h:713:
+^I/**$

ERROR: code indent should never use tabs
#2015: FILE: tools/virtiofsd/fuse_common.h:714:
+^I * Index of current buffer within the array$

ERROR: code indent should never use tabs
#2016: FILE: tools/virtiofsd/fuse_common.h:715:
+^I */$

ERROR: code indent should never use tabs
#2017: FILE: tools/virtiofsd/fuse_common.h:716:
+^Isize_t idx;$

ERROR: code indent should never use tabs
#2019: FILE: tools/virtiofsd/fuse_common.h:718:
+^I/**$

ERROR: code indent should never use tabs
#2020: FILE: tools/virtiofsd/fuse_common.h:719:
+^I * Current offset within the current buffer$

ERROR: code indent should never use tabs
#2021: FILE: tools/virtiofsd/fuse_common.h:720:
+^I */$

ERROR: code indent should never use tabs
#2022: FILE: tools/virtiofsd/fuse_common.h:721:
+^Isize_t off;$

ERROR: code indent should never use tabs
#2024: FILE: tools/virtiofsd/fuse_common.h:723:
+^I/**$

ERROR: code indent should never use tabs
#2025: FILE: tools/virtiofsd/fuse_common.h:724:
+^I * Array of buffers$

ERROR: code indent should never use tabs
#2026: FILE: tools/virtiofsd/fuse_common.h:725:
+^I */$

ERROR: code indent should never use tabs
#2027: FILE: tools/virtiofsd/fuse_common.h:726:
+^Istruct fuse_buf buf[1];$

ERROR: code indent should never use tabs
#2031: FILE: tools/virtiofsd/fuse_common.h:730:
+#define FUSE_BUFVEC_INIT(size__)^I^I^I^I\$

ERROR: code indent should never use tabs
#2032: FILE: tools/virtiofsd/fuse_common.h:731:
+^I((struct fuse_bufvec) {^I^I^I^I^I\$

ERROR: code indent should never use tabs
#2033: FILE: tools/virtiofsd/fuse_common.h:732:
+^I^I/* .count= */ 1,^I^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2033: FILE: tools/virtiofsd/fuse_common.h:732:
+ /* .count= */ 1, \

ERROR: code indent should never use tabs
#2034: FILE: tools/virtiofsd/fuse_common.h:733:
+^I^I/* .idx = */ 0,^I^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2034: FILE: tools/virtiofsd/fuse_common.h:733:
+ /* .idx = */ 0, \

ERROR: code indent should never use tabs
#2035: FILE: tools/virtiofsd/fuse_common.h:734:
+^I^I/* .off = */ 0,^I^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2035: FILE: tools/virtiofsd/fuse_common.h:734:
+ /* .off = */ 0, \

ERROR: code indent should never use tabs
#2036: FILE: tools/virtiofsd/fuse_common.h:735:
+^I^I/* .buf = */ { /* [0] = */ {^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2036: FILE: tools/virtiofsd/fuse_common.h:735:
+ /* .buf = */ { /* [0] = */ { \

ERROR: code indent should never use tabs
#2037: FILE: tools/virtiofsd/fuse_common.h:736:
+^I^I^I/* .size = */ (size__),^I^I\$

WARNING: Block comments use a leading /* on a separate line #2037: FILE: tools/virtiofsd/fuse_common.h:736:
+ /* .size = */ (size__), \

ERROR: code indent should never use tabs #2038: FILE: tools/virtiofsd/fuse_common.h:737:
+^I^I^I/* .flags = */ (enum fuse_buf_flags) 0,^I\$

WARNING: Block comments use a leading /* on a separate line #2038: FILE: tools/virtiofsd/fuse_common.h:737:
+ /* .flags = */ (enum fuse_buf_flags) 0, \

ERROR: code indent should never use tabs
#2039: FILE: tools/virtiofsd/fuse_common.h:738:
+^I^I^I/* .mem = */ NULL,^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2039: FILE: tools/virtiofsd/fuse_common.h:738:
+ /* .mem = */ NULL, \

ERROR: code indent should never use tabs
#2040: FILE: tools/virtiofsd/fuse_common.h:739:
+^I^I^I/* .fd = */ -1,^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2040: FILE: tools/virtiofsd/fuse_common.h:739:
+ /* .fd = */ -1, \

ERROR: code indent should never use tabs
#2041: FILE: tools/virtiofsd/fuse_common.h:740:
+^I^I^I/* .pos = */ 0,^I^I^I\$

WARNING: Block comments use a leading /* on a separate line #2041: FILE: tools/virtiofsd/fuse_common.h:740:
+ /* .pos = */ 0, \

ERROR: code indent should never use tabs
#2042: FILE: tools/virtiofsd/fuse_common.h:741:
+^I^I} }^I^I^I^I^I^I\$

ERROR: code indent should never use tabs
#2043: FILE: tools/virtiofsd/fuse_common.h:742:
+^I} )$

ERROR: space prohibited before that close parenthesis ')' #2043: FILE: tools/virtiofsd/fuse_common.h:742:
+ } )

ERROR: code indent should never use tabs
#2062: FILE: tools/virtiofsd/fuse_common.h:761:
+^I^I enum fuse_buf_copy_flags flags);$

WARNING: Block comments use a leading /* on a separate line #2064: FILE: tools/virtiofsd/fuse_common.h:763:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#2065: FILE: tools/virtiofsd/fuse_common.h:764:
+ * Signal handling^I^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #2066: FILE: tools/virtiofsd/fuse_common.h:765:
+ * ----------------------------------------------------------- */

ERROR: code indent should never use tabs
#2071: FILE: tools/virtiofsd/fuse_common.h:770:
+ * Stores session in a global variable.^I May only be called once per$

WARNING: Block comments use a leading /* on a separate line #2098: FILE: tools/virtiofsd/fuse_common.h:797:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#2099: FILE: tools/virtiofsd/fuse_common.h:798:
+ * Compatibility stuff^I^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #2100: FILE: tools/virtiofsd/fuse_common.h:799:
+ * ----------------------------------------------------------- */

WARNING: architecture specific defines should be avoided #2106: FILE: tools/virtiofsd/fuse_common.h:805:
+#ifdef __cplusplus

ERROR: line over 90 characters
#2117: FILE: tools/virtiofsd/fuse_common.h:816:
+#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && !defined __cplusplus

WARNING: architecture specific defines should be avoided
#2117: FILE: tools/virtiofsd/fuse_common.h:816:
+#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && !defined __cplusplus

ERROR: code indent should never use tabs
#2121: FILE: tools/virtiofsd/fuse_common.h:820:
+^I{ unsigned _fuse_off_t_must_be_64bit:((sizeof(off_t) == 8) ? 1 : -1); };$

WARNING: Block comments use * on subsequent lines
#2132: FILE: tools/virtiofsd/fuse_i.h:2:
+/*
+ FUSE: Filesystem in Userspace

ERROR: code indent should never use tabs
#2145: FILE: tools/virtiofsd/fuse_i.h:15:
+^Istruct fuse_session *se;$

ERROR: code indent should never use tabs
#2146: FILE: tools/virtiofsd/fuse_i.h:16:
+^Iuint64_t unique;$

ERROR: code indent should never use tabs
#2147: FILE: tools/virtiofsd/fuse_i.h:17:
+^Iint ctr;$

ERROR: code indent should never use tabs
#2148: FILE: tools/virtiofsd/fuse_i.h:18:
+^Ipthread_mutex_t lock;$

ERROR: code indent should never use tabs
#2149: FILE: tools/virtiofsd/fuse_i.h:19:
+^Istruct fuse_ctx ctx;$

ERROR: code indent should never use tabs
#2150: FILE: tools/virtiofsd/fuse_i.h:20:
+^Istruct fuse_chan *ch;$

ERROR: code indent should never use tabs
#2151: FILE: tools/virtiofsd/fuse_i.h:21:
+^Iint interrupted;$

ERROR: code indent should never use tabs
#2152: FILE: tools/virtiofsd/fuse_i.h:22:
+^Iunsigned int ioctl_64bit : 1;$

ERROR: spaces prohibited around that ':' (ctx:WxW) #2152: FILE: tools/virtiofsd/fuse_i.h:22:

+       unsigned int ioctl_64bit : 1;
                                 ^

ERROR: code indent should never use tabs
#2153: FILE: tools/virtiofsd/fuse_i.h:23:
+^Iunion {$

ERROR: code indent should never use tabs
#2154: FILE: tools/virtiofsd/fuse_i.h:24:
+^I^Istruct {$

ERROR: code indent should never use tabs
#2155: FILE: tools/virtiofsd/fuse_i.h:25:
+^I^I^Iuint64_t unique;$

ERROR: code indent should never use tabs
#2156: FILE: tools/virtiofsd/fuse_i.h:26:
+^I^I} i;$

ERROR: code indent should never use tabs
#2157: FILE: tools/virtiofsd/fuse_i.h:27:
+^I^Istruct {$

ERROR: code indent should never use tabs
#2158: FILE: tools/virtiofsd/fuse_i.h:28:
+^I^I^Ifuse_interrupt_func_t func;$

ERROR: code indent should never use tabs
#2159: FILE: tools/virtiofsd/fuse_i.h:29:
+^I^I^Ivoid *data;$

ERROR: code indent should never use tabs
#2160: FILE: tools/virtiofsd/fuse_i.h:30:
+^I^I} ni;$

ERROR: code indent should never use tabs
#2161: FILE: tools/virtiofsd/fuse_i.h:31:
+^I} u;$

ERROR: code indent should never use tabs
#2162: FILE: tools/virtiofsd/fuse_i.h:32:
+^Istruct fuse_req *next;$

ERROR: code indent should never use tabs
#2163: FILE: tools/virtiofsd/fuse_i.h:33:
+^Istruct fuse_req *prev;$

ERROR: code indent should never use tabs
#2167: FILE: tools/virtiofsd/fuse_i.h:37:
+^Iuint64_t unique;$

ERROR: code indent should never use tabs
#2168: FILE: tools/virtiofsd/fuse_i.h:38:
+^Ivoid (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,$

ERROR: code indent should never use tabs
#2169: FILE: tools/virtiofsd/fuse_i.h:39:
+^I^I const void *, const struct fuse_buf *);$

ERROR: code indent should never use tabs
#2170: FILE: tools/virtiofsd/fuse_i.h:40:
+^Istruct fuse_notify_req *next;$

ERROR: code indent should never use tabs
#2171: FILE: tools/virtiofsd/fuse_i.h:41:
+^Istruct fuse_notify_req *prev;$

ERROR: code indent should never use tabs
#2175: FILE: tools/virtiofsd/fuse_i.h:45:
+^Ichar *mountpoint;$

ERROR: code indent should never use tabs
#2176: FILE: tools/virtiofsd/fuse_i.h:46:
+^Ivolatile int exited;$

ERROR: Use of volatile is usually wrong, please add a comment #2176: FILE: tools/virtiofsd/fuse_i.h:46:
+ volatile int exited;

ERROR: code indent should never use tabs
#2177: FILE: tools/virtiofsd/fuse_i.h:47:
+^Iint fd;$

ERROR: code indent should never use tabs
#2178: FILE: tools/virtiofsd/fuse_i.h:48:
+^Istruct mount_opts *mo;$

ERROR: code indent should never use tabs
#2179: FILE: tools/virtiofsd/fuse_i.h:49:
+^Iint debug;$

ERROR: code indent should never use tabs
#2180: FILE: tools/virtiofsd/fuse_i.h:50:
+^Iint deny_others;$

ERROR: code indent should never use tabs
#2181: FILE: tools/virtiofsd/fuse_i.h:51:
+^Istruct fuse_lowlevel_ops op;$

ERROR: code indent should never use tabs
#2182: FILE: tools/virtiofsd/fuse_i.h:52:
+^Iint got_init;$

ERROR: code indent should never use tabs
#2183: FILE: tools/virtiofsd/fuse_i.h:53:
+^Istruct cuse_data *cuse_data;$

ERROR: code indent should never use tabs
#2184: FILE: tools/virtiofsd/fuse_i.h:54:
+^Ivoid *userdata;$

ERROR: code indent should never use tabs
#2185: FILE: tools/virtiofsd/fuse_i.h:55:
+^Iuid_t owner;$

ERROR: code indent should never use tabs
#2186: FILE: tools/virtiofsd/fuse_i.h:56:
+^Istruct fuse_conn_info conn;$

ERROR: code indent should never use tabs
#2187: FILE: tools/virtiofsd/fuse_i.h:57:
+^Istruct fuse_req list;$

ERROR: code indent should never use tabs
#2188: FILE: tools/virtiofsd/fuse_i.h:58:
+^Istruct fuse_req interrupts;$

ERROR: code indent should never use tabs
#2189: FILE: tools/virtiofsd/fuse_i.h:59:
+^Ipthread_mutex_t lock;$

ERROR: code indent should never use tabs
#2190: FILE: tools/virtiofsd/fuse_i.h:60:
+^Iint got_destroy;$

ERROR: code indent should never use tabs
#2191: FILE: tools/virtiofsd/fuse_i.h:61:
+^Ipthread_key_t pipe_key;$

ERROR: code indent should never use tabs
#2192: FILE: tools/virtiofsd/fuse_i.h:62:
+^Iint broken_splice_nonblock;$

ERROR: code indent should never use tabs
#2193: FILE: tools/virtiofsd/fuse_i.h:63:
+^Iuint64_t notify_ctr;$

ERROR: code indent should never use tabs
#2194: FILE: tools/virtiofsd/fuse_i.h:64:
+^Istruct fuse_notify_req notify_list;$

ERROR: code indent should never use tabs
#2195: FILE: tools/virtiofsd/fuse_i.h:65:
+^Isize_t bufsize;$

ERROR: code indent should never use tabs
#2196: FILE: tools/virtiofsd/fuse_i.h:66:
+^Iint error;$

ERROR: code indent should never use tabs
#2200: FILE: tools/virtiofsd/fuse_i.h:70:
+^Ipthread_mutex_t lock;$

ERROR: code indent should never use tabs
#2201: FILE: tools/virtiofsd/fuse_i.h:71:
+^Iint ctr;$

ERROR: code indent should never use tabs
#2202: FILE: tools/virtiofsd/fuse_i.h:72:
+^Iint fd;$

ERROR: code indent should never use tabs
#2213: FILE: tools/virtiofsd/fuse_i.h:83:
+^Ichar *name;$

ERROR: code indent should never use tabs
#2214: FILE: tools/virtiofsd/fuse_i.h:84:
+^Ifuse_module_factory_t factory;$

ERROR: code indent should never use tabs
#2215: FILE: tools/virtiofsd/fuse_i.h:85:
+^Istruct fuse_module *next;$

ERROR: code indent should never use tabs
#2216: FILE: tools/virtiofsd/fuse_i.h:86:
+^Istruct fusemod_so *so;$

ERROR: code indent should never use tabs
#2217: FILE: tools/virtiofsd/fuse_i.h:87:
+^Iint ctr;$

WARNING: Block comments use a leading /* on a separate line #2220: FILE: tools/virtiofsd/fuse_i.h:90:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#2221: FILE: tools/virtiofsd/fuse_i.h:91:
+ * Channel interface (when using -o clone_fd)^I^I *$

WARNING: Block comments use a trailing */ on a separate line #2222: FILE: tools/virtiofsd/fuse_i.h:92:
+ * ----------------------------------------------------------- */

ERROR: code indent should never use tabs
#2247: FILE: tools/virtiofsd/fuse_i.h:117:
+^I^I^I int count);$

ERROR: code indent should never use tabs
#2255: FILE: tools/virtiofsd/fuse_i.h:125:
+^I^I^I^I struct fuse_chan *ch);$

WARNING: line over 80 characters
#2257: FILE: tools/virtiofsd/fuse_i.h:127:
+ const struct fuse_buf *buf, struct fuse_chan *ch);

ERROR: code indent should never use tabs
#2257: FILE: tools/virtiofsd/fuse_i.h:127:
+^I^I^I^I const struct fuse_buf *buf, struct fuse_chan *ch);$

WARNING: line over 80 characters
#2259: FILE: tools/virtiofsd/fuse_i.h:129:
+struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *op,

ERROR: code indent should never use tabs
#2260: FILE: tools/virtiofsd/fuse_i.h:130:
+^I^I size_t op_size, void *private_data);$

WARNING: line over 80 characters
#2262: FILE: tools/virtiofsd/fuse_i.h:132:
+int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *config);

WARNING: Block comments use * on subsequent lines
#2277: FILE: tools/virtiofsd/fuse_log.h:2:
+/*
+ FUSE: Filesystem in Userspace

WARNING: Block comments use a leading /* on a separate line #2287: FILE: tools/virtiofsd/fuse_log.h:12:
+/** @file

WARNING: architecture specific defines should be avoided #2294: FILE: tools/virtiofsd/fuse_log.h:19:
+#ifdef __cplusplus

ERROR: code indent should never use tabs
#2304: FILE: tools/virtiofsd/fuse_log.h:29:
+^IFUSE_LOG_EMERG,$

ERROR: code indent should never use tabs
#2305: FILE: tools/virtiofsd/fuse_log.h:30:
+^IFUSE_LOG_ALERT,$

ERROR: code indent should never use tabs
#2306: FILE: tools/virtiofsd/fuse_log.h:31:
+^IFUSE_LOG_CRIT,$

ERROR: code indent should never use tabs
#2307: FILE: tools/virtiofsd/fuse_log.h:32:
+^IFUSE_LOG_ERR,$

ERROR: code indent should never use tabs
#2308: FILE: tools/virtiofsd/fuse_log.h:33:
+^IFUSE_LOG_WARNING,$

ERROR: code indent should never use tabs
#2309: FILE: tools/virtiofsd/fuse_log.h:34:
+^IFUSE_LOG_NOTICE,$

ERROR: code indent should never use tabs
#2310: FILE: tools/virtiofsd/fuse_log.h:35:
+^IFUSE_LOG_INFO,$

ERROR: code indent should never use tabs
#2311: FILE: tools/virtiofsd/fuse_log.h:36:
+^IFUSE_LOG_DEBUG$

ERROR: code indent should never use tabs
#2328: FILE: tools/virtiofsd/fuse_log.h:53:
+^I^I^I^Iconst char *fmt, va_list ap);$

WARNING: architecture specific defines should be avoided #2353: FILE: tools/virtiofsd/fuse_log.h:78:
+#ifdef __cplusplus

WARNING: Block comments use * on subsequent lines
#2365: FILE: tools/virtiofsd/fuse_lowlevel.h:2:
+/*
+ FUSE: Filesystem in Userspace

WARNING: Block comments use a leading /* on a separate line #2375: FILE: tools/virtiofsd/fuse_lowlevel.h:12:
+/** @file

WARNING: architecture specific defines should be avoided #2397: FILE: tools/virtiofsd/fuse_lowlevel.h:34:
+#ifdef __cplusplus

WARNING: Block comments use a leading /* on a separate line #2401: FILE: tools/virtiofsd/fuse_lowlevel.h:38:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#2402: FILE: tools/virtiofsd/fuse_lowlevel.h:39:
+ * Miscellaneous definitions^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #2403: FILE: tools/virtiofsd/fuse_lowlevel.h:40:
+ * ----------------------------------------------------------- */

ERROR: code indent should never use tabs
#2423: FILE: tools/virtiofsd/fuse_lowlevel.h:60:
+^I/** Unique inode number$

WARNING: Block comments use a leading /* on a separate line #2423: FILE: tools/virtiofsd/fuse_lowlevel.h:60:
+ /** Unique inode number

ERROR: code indent should never use tabs
#2424: FILE: tools/virtiofsd/fuse_lowlevel.h:61:
+^I *$

ERROR: code indent should never use tabs
#2425: FILE: tools/virtiofsd/fuse_lowlevel.h:62:
+^I * In lookup, zero means negative entry (from version 2.5)$

ERROR: code indent should never use tabs
#2426: FILE: tools/virtiofsd/fuse_lowlevel.h:63:
+^I * Returning ENOENT also means negative entry, but by setting zero$

ERROR: code indent should never use tabs
#2427: FILE: tools/virtiofsd/fuse_lowlevel.h:64:
+^I * ino the kernel may cache negative entries for entry_timeout$

ERROR: code indent should never use tabs
#2428: FILE: tools/virtiofsd/fuse_lowlevel.h:65:
+^I * seconds.$

ERROR: code indent should never use tabs
#2429: FILE: tools/virtiofsd/fuse_lowlevel.h:66:
+^I */$

ERROR: code indent should never use tabs
#2430: FILE: tools/virtiofsd/fuse_lowlevel.h:67:
+^Ifuse_ino_t ino;$

ERROR: code indent should never use tabs
#2432: FILE: tools/virtiofsd/fuse_lowlevel.h:69:
+^I/** Generation number for this entry.$

WARNING: Block comments use a leading /* on a separate line #2432: FILE: tools/virtiofsd/fuse_lowlevel.h:69:
+ /** Generation number for this entry.

ERROR: code indent should never use tabs
#2433: FILE: tools/virtiofsd/fuse_lowlevel.h:70:
+^I *$

ERROR: code indent should never use tabs
#2434: FILE: tools/virtiofsd/fuse_lowlevel.h:71:
+^I * If the file system will be exported over NFS, the$

ERROR: code indent should never use tabs
#2435: FILE: tools/virtiofsd/fuse_lowlevel.h:72:
+^I * ino/generation pairs need to be unique over the file$

ERROR: code indent should never use tabs
#2436: FILE: tools/virtiofsd/fuse_lowlevel.h:73:
+^I * system's lifetime (rather than just the mount time). So if$

ERROR: code indent should never use tabs
#2437: FILE: tools/virtiofsd/fuse_lowlevel.h:74:
+^I * the file system reuses an inode after it has been deleted,$

ERROR: code indent should never use tabs
#2438: FILE: tools/virtiofsd/fuse_lowlevel.h:75:
+^I * it must assign a new, previously unused generation number$

ERROR: code indent should never use tabs
#2439: FILE: tools/virtiofsd/fuse_lowlevel.h:76:
+^I * to the inode at the same time.$

ERROR: code indent should never use tabs
#2440: FILE: tools/virtiofsd/fuse_lowlevel.h:77:
+^I *$

ERROR: code indent should never use tabs
#2441: FILE: tools/virtiofsd/fuse_lowlevel.h:78:
+^I */$

ERROR: code indent should never use tabs
#2442: FILE: tools/virtiofsd/fuse_lowlevel.h:79:
+^Iuint64_t generation;$

ERROR: code indent should never use tabs
#2444: FILE: tools/virtiofsd/fuse_lowlevel.h:81:
+^I/** Inode attributes.$

WARNING: Block comments use a leading /* on a separate line #2444: FILE: tools/virtiofsd/fuse_lowlevel.h:81:
+ /** Inode attributes.

ERROR: code indent should never use tabs
#2445: FILE: tools/virtiofsd/fuse_lowlevel.h:82:
+^I *$

ERROR: code indent should never use tabs
#2446: FILE: tools/virtiofsd/fuse_lowlevel.h:83:
+^I * Even if attr_timeout == 0, attr must be correct. For example,$

ERROR: code indent should never use tabs
#2447: FILE: tools/virtiofsd/fuse_lowlevel.h:84:
+^I * for open(), FUSE uses attr.st_size from lookup() to determine$

ERROR: code indent should never use tabs
#2448: FILE: tools/virtiofsd/fuse_lowlevel.h:85:
+^I * how many bytes to request. If this value is not correct,$

ERROR: code indent should never use tabs
#2449: FILE: tools/virtiofsd/fuse_lowlevel.h:86:
+^I * incorrect data will be returned.$

ERROR: code indent should never use tabs
#2450: FILE: tools/virtiofsd/fuse_lowlevel.h:87:
+^I */$

ERROR: code indent should never use tabs
#2451: FILE: tools/virtiofsd/fuse_lowlevel.h:88:
+^Istruct stat attr;$

ERROR: code indent should never use tabs
#2453: FILE: tools/virtiofsd/fuse_lowlevel.h:90:
+^I/** Validity timeout (in seconds) for inode attributes. If$

WARNING: Block comments use a leading /* on a separate line #2453: FILE: tools/virtiofsd/fuse_lowlevel.h:90:
+ /** Validity timeout (in seconds) for inode attributes. If

ERROR: code indent should never use tabs
#2454: FILE: tools/virtiofsd/fuse_lowlevel.h:91:
+^I attributes only change as a result of requests that come$

WARNING: Block comments use * on subsequent lines
#2454: FILE: tools/virtiofsd/fuse_lowlevel.h:91:
+ /** Validity timeout (in seconds) for inode attributes. If
+ attributes only change as a result of requests that come

ERROR: code indent should never use tabs
#2455: FILE: tools/virtiofsd/fuse_lowlevel.h:92:
+^I through the kernel, this should be set to a very large$

ERROR: code indent should never use tabs
#2456: FILE: tools/virtiofsd/fuse_lowlevel.h:93:
+^I value. */$

WARNING: Block comments use a trailing */ on a separate line #2456: FILE: tools/virtiofsd/fuse_lowlevel.h:93:
+ value. */

ERROR: code indent should never use tabs
#2457: FILE: tools/virtiofsd/fuse_lowlevel.h:94:
+^Idouble attr_timeout;$

ERROR: code indent should never use tabs
#2459: FILE: tools/virtiofsd/fuse_lowlevel.h:96:
+^I/** Validity timeout (in seconds) for the name. If directory$

WARNING: Block comments use a leading /* on a separate line #2459: FILE: tools/virtiofsd/fuse_lowlevel.h:96:
+ /** Validity timeout (in seconds) for the name. If directory

ERROR: code indent should never use tabs
#2460: FILE: tools/virtiofsd/fuse_lowlevel.h:97:
+^I entries are changed/deleted only as a result of requests$

WARNING: Block comments use * on subsequent lines
#2460: FILE: tools/virtiofsd/fuse_lowlevel.h:97:
+ /** Validity timeout (in seconds) for the name. If directory
+ entries are changed/deleted only as a result of requests

ERROR: code indent should never use tabs
#2461: FILE: tools/virtiofsd/fuse_lowlevel.h:98:
+^I that come through the kernel, this should be set to a very$

ERROR: code indent should never use tabs
#2462: FILE: tools/virtiofsd/fuse_lowlevel.h:99:
+^I large value. */$

WARNING: Block comments use a trailing */ on a separate line #2462: FILE: tools/virtiofsd/fuse_lowlevel.h:99:
+ large value. */

ERROR: code indent should never use tabs
#2463: FILE: tools/virtiofsd/fuse_lowlevel.h:100:
+^Idouble entry_timeout;$

ERROR: code indent should never use tabs
#2475: FILE: tools/virtiofsd/fuse_lowlevel.h:112:
+^I/** User ID of the calling process */$

ERROR: code indent should never use tabs
#2476: FILE: tools/virtiofsd/fuse_lowlevel.h:113:
+^Iuid_t uid;$

ERROR: code indent should never use tabs
#2478: FILE: tools/virtiofsd/fuse_lowlevel.h:115:
+^I/** Group ID of the calling process */$

ERROR: code indent should never use tabs
#2479: FILE: tools/virtiofsd/fuse_lowlevel.h:116:
+^Igid_t gid;$

ERROR: code indent should never use tabs
#2481: FILE: tools/virtiofsd/fuse_lowlevel.h:118:
+^I/** Thread ID of the calling process */$

ERROR: code indent should never use tabs
#2482: FILE: tools/virtiofsd/fuse_lowlevel.h:119:
+^Ipid_t pid;$

ERROR: code indent should never use tabs
#2484: FILE: tools/virtiofsd/fuse_lowlevel.h:121:
+^I/** Umask of the calling process */$

ERROR: code indent should never use tabs
#2485: FILE: tools/virtiofsd/fuse_lowlevel.h:122:
+^Imode_t umask;$

ERROR: code indent should never use tabs
#2489: FILE: tools/virtiofsd/fuse_lowlevel.h:126:
+^Ifuse_ino_t ino;$

ERROR: code indent should never use tabs
#2490: FILE: tools/virtiofsd/fuse_lowlevel.h:127:
+^Iuint64_t nlookup;$

ERROR: code indent should never use tabs
#2494: FILE: tools/virtiofsd/fuse_lowlevel.h:131:
+#define FUSE_SET_ATTR_MODE^I(1 << 0)$

ERROR: code indent should never use tabs
#2495: FILE: tools/virtiofsd/fuse_lowlevel.h:132:
+#define FUSE_SET_ATTR_UID^I(1 << 1)$

ERROR: code indent should never use tabs
#2496: FILE: tools/virtiofsd/fuse_lowlevel.h:133:
+#define FUSE_SET_ATTR_GID^I(1 << 2)$

ERROR: code indent should never use tabs
#2497: FILE: tools/virtiofsd/fuse_lowlevel.h:134:
+#define FUSE_SET_ATTR_SIZE^I(1 << 3)$

ERROR: code indent should never use tabs
#2498: FILE: tools/virtiofsd/fuse_lowlevel.h:135:
+#define FUSE_SET_ATTR_ATIME^I(1 << 4)$

ERROR: code indent should never use tabs
#2499: FILE: tools/virtiofsd/fuse_lowlevel.h:136:
+#define FUSE_SET_ATTR_MTIME^I(1 << 5)$

ERROR: code indent should never use tabs
#2500: FILE: tools/virtiofsd/fuse_lowlevel.h:137:
+#define FUSE_SET_ATTR_ATIME_NOW^I(1 << 7)$

ERROR: code indent should never use tabs
#2501: FILE: tools/virtiofsd/fuse_lowlevel.h:138:
+#define FUSE_SET_ATTR_MTIME_NOW^I(1 << 8)$

ERROR: code indent should never use tabs
#2502: FILE: tools/virtiofsd/fuse_lowlevel.h:139:
+#define FUSE_SET_ATTR_CTIME^I(1 << 10)$

WARNING: Block comments use a leading /* on a separate line #2504: FILE: tools/virtiofsd/fuse_lowlevel.h:141:
+/* ----------------------------------------------------------- *

ERROR: code indent should never use tabs
#2505: FILE: tools/virtiofsd/fuse_lowlevel.h:142:
+ * Request methods and replies^I^I^I^I *$

WARNING: Block comments use a trailing */ on a separate line #2506: FILE: tools/virtiofsd/fuse_lowlevel.h:143:
+ * ----------------------------------------------------------- */

ERROR: code indent should never use tabs
#2536: FILE: tools/virtiofsd/fuse_lowlevel.h:173:
+^I/**$

ERROR: code indent should never use tabs
#2537: FILE: tools/virtiofsd/fuse_lowlevel.h:174:
+^I * Initialize filesystem$

ERROR: code indent should never use tabs
#2538: FILE: tools/virtiofsd/fuse_lowlevel.h:175:
+^I *$

ERROR: code indent should never use tabs #2539: FILE: tools/virtiofsd/fuse_lowlevel.h:176:
+^I * This function is called when libfuse establishes$

ERROR: code indent should never use tabs
#2540: FILE: tools/virtiofsd/fuse_lowlevel.h:177:
+^I * communication with the FUSE kernel module. The file system$

ERROR: code indent should never use tabs
#2541: FILE: tools/virtiofsd/fuse_lowlevel.h:178:
+^I * should use this module to inspect and/or modify the$

ERROR: code indent should never use tabs
#2542: FILE: tools/virtiofsd/fuse_lowlevel.h:179:
+^I * connection parameters provided in the conn structure.$

ERROR: code indent should never use tabs
#2543: FILE: tools/virtiofsd/fuse_lowlevel.h:180:
+^I *$

ERROR: code indent should never use tabs
#2544: FILE: tools/virtiofsd/fuse_lowlevel.h:181:
+^I * Note that some parameters may be overwritten by options$

ERROR: code indent should never use tabs
#2545: FILE: tools/virtiofsd/fuse_lowlevel.h:182:
+^I * passed to fuse_session_new() which take precedence over the$

ERROR: code indent should never use tabs
#2546: FILE: tools/virtiofsd/fuse_lowlevel.h:183:
+^I * values set in this handler.$

ERROR: code indent should never use tabs
#2547: FILE: tools/virtiofsd/fuse_lowlevel.h:184:
+^I *$

ERROR: code indent should never use tabs
#2548: FILE: tools/virtiofsd/fuse_lowlevel.h:185:
+^I * There's no reply to this function$

ERROR: code indent should never use tabs
#2549: FILE: tools/virtiofsd/fuse_lowlevel.h:186:
+^I *$

ERROR: code indent should never use tabs
#2550: FILE: tools/virtiofsd/fuse_lowlevel.h:187:
+^I * @param userdata the user data passed to fuse_session_new()$

ERROR: code indent should never use tabs
#2551: FILE: tools/virtiofsd/fuse_lowlevel.h:188:
+^I */$

ERROR: code indent should never use tabs
#2552: FILE: tools/virtiofsd/fuse_lowlevel.h:189:
+^Ivoid (*init) (void *userdata, struct fuse_conn_info *conn);$

ERROR: code indent should never use tabs
#2554: FILE: tools/virtiofsd/fuse_lowlevel.h:191:
+^I/**$

ERROR: code indent should never use tabs
#2555: FILE: tools/virtiofsd/fuse_lowlevel.h:192:
+^I * Clean up filesystem.$

ERROR: code indent should never use tabs
#2556: FILE: tools/virtiofsd/fuse_lowlevel.h:193:
+^I *$

ERROR: code indent should never use tabs
#2557: FILE: tools/virtiofsd/fuse_lowlevel.h:194:
+^I * Called on filesystem exit. When this method is called, the$

ERROR: code indent should never use tabs
#2558: FILE: tools/virtiofsd/fuse_lowlevel.h:195:
+^I * connection to the kernel may be gone already, so that eg. calls$

ERROR: code indent should never use tabs
#2559: FILE: tools/virtiofsd/fuse_lowlevel.h:196:
+^I * to fuse_lowlevel_notify_* will fail.$

ERROR: code indent should never use tabs
#2560: FILE: tools/virtiofsd/fuse_lowlevel.h:197:
+^I *$

ERROR: code indent should never use tabs
#2561: FILE: tools/virtiofsd/fuse_lowlevel.h:198:
+^I * There's no reply to this function$

ERROR: code indent should never use tabs
#2562: FILE: tools/virtiofsd/fuse_lowlevel.h:199:
+^I *$

ERROR: code indent should never use tabs
#2563: FILE: tools/virtiofsd/fuse_lowlevel.h:200:
+^I * @param userdata the user data passed to fuse_session_new()$

ERROR: code indent should never use tabs
#2564: FILE: tools/virtiofsd/fuse_lowlevel.h:201:
+^I */$

ERROR: code indent should never use tabs
#2565: FILE: tools/virtiofsd/fuse_lowlevel.h:202:
+^Ivoid (*destroy) (void *userdata);$

ERROR: code indent should never use tabs
#2567: FILE: tools/virtiofsd/fuse_lowlevel.h:204:
+^I/**$

ERROR: code indent should never use tabs
#2568: FILE: tools/virtiofsd/fuse_lowlevel.h:205:
+^I * Look up a directory entry by name and get its attributes.$

ERROR: code indent should never use tabs
#2569: FILE: tools/virtiofsd/fuse_lowlevel.h:206:
+^I *$

ERROR: code indent should never use tabs
#2570: FILE: tools/virtiofsd/fuse_lowlevel.h:207:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2571: FILE: tools/virtiofsd/fuse_lowlevel.h:208:
+^I * fuse_reply_entry$

ERROR: code indent should never use tabs
#2572: FILE: tools/virtiofsd/fuse_lowlevel.h:209:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2573: FILE: tools/virtiofsd/fuse_lowlevel.h:210:
+^I *$

ERROR: code indent should never use tabs
#2574: FILE: tools/virtiofsd/fuse_lowlevel.h:211:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2575: FILE: tools/virtiofsd/fuse_lowlevel.h:212:
+^I * @param parent inode number of the parent directory$

ERROR: code indent should never use tabs
#2576: FILE: tools/virtiofsd/fuse_lowlevel.h:213:
+^I * @param name the name to look up$

ERROR: code indent should never use tabs
#2577: FILE: tools/virtiofsd/fuse_lowlevel.h:214:
+^I */$

ERROR: code indent should never use tabs
#2578: FILE: tools/virtiofsd/fuse_lowlevel.h:215:
+^Ivoid (*lookup) (fuse_req_t req, fuse_ino_t parent, const char *name);$

ERROR: code indent should never use tabs
#2580: FILE: tools/virtiofsd/fuse_lowlevel.h:217:
+^I/**$

ERROR: code indent should never use tabs
#2581: FILE: tools/virtiofsd/fuse_lowlevel.h:218:
+^I * Forget about an inode$

ERROR: code indent should never use tabs
#2582: FILE: tools/virtiofsd/fuse_lowlevel.h:219:
+^I *$

ERROR: code indent should never use tabs
#2583: FILE: tools/virtiofsd/fuse_lowlevel.h:220:
+^I * This function is called when the kernel removes an inode$

ERROR: code indent should never use tabs
#2584: FILE: tools/virtiofsd/fuse_lowlevel.h:221:
+^I * from its internal caches.$

ERROR: code indent should never use tabs
#2585: FILE: tools/virtiofsd/fuse_lowlevel.h:222:
+^I *$

ERROR: code indent should never use tabs
#2586: FILE: tools/virtiofsd/fuse_lowlevel.h:223:
+^I * The inode's lookup count increases by one for every call to$

ERROR: code indent should never use tabs
#2587: FILE: tools/virtiofsd/fuse_lowlevel.h:224:
+^I * fuse_reply_entry and fuse_reply_create. The nlookup parameter$

ERROR: code indent should never use tabs
#2588: FILE: tools/virtiofsd/fuse_lowlevel.h:225:
+^I * indicates by how much the lookup count should be decreased.$

ERROR: code indent should never use tabs
#2589: FILE: tools/virtiofsd/fuse_lowlevel.h:226:
+^I *$

ERROR: code indent should never use tabs
#2590: FILE: tools/virtiofsd/fuse_lowlevel.h:227:
+^I * Inodes with a non-zero lookup count may receive request from$

ERROR: code indent should never use tabs
#2591: FILE: tools/virtiofsd/fuse_lowlevel.h:228:
+^I * the kernel even after calls to unlink, rmdir or (when$

ERROR: code indent should never use tabs
#2592: FILE: tools/virtiofsd/fuse_lowlevel.h:229:
+^I * overwriting an existing file) rename. Filesystems must handle$

ERROR: code indent should never use tabs
#2593: FILE: tools/virtiofsd/fuse_lowlevel.h:230:
+^I * such requests properly and it is recommended to defer removal$

ERROR: code indent should never use tabs
#2594: FILE: tools/virtiofsd/fuse_lowlevel.h:231:
+^I * of the inode until the lookup count reaches zero. Calls to$

ERROR: code indent should never use tabs
#2595: FILE: tools/virtiofsd/fuse_lowlevel.h:232:
+^I * unlink, rmdir or rename will be followed closely by forget$

ERROR: code indent should never use tabs
#2596: FILE: tools/virtiofsd/fuse_lowlevel.h:233:
+^I * unless the file or directory is open, in which case the$

ERROR: code indent should never use tabs
#2597: FILE: tools/virtiofsd/fuse_lowlevel.h:234:
+^I * kernel issues forget only after the release or releasedir$

ERROR: code indent should never use tabs
#2598: FILE: tools/virtiofsd/fuse_lowlevel.h:235:
+^I * calls.$

ERROR: code indent should never use tabs
#2599: FILE: tools/virtiofsd/fuse_lowlevel.h:236:
+^I *$

ERROR: code indent should never use tabs
#2600: FILE: tools/virtiofsd/fuse_lowlevel.h:237:
+^I * Note that if a file system will be exported over NFS the$

ERROR: code indent should never use tabs
#2601: FILE: tools/virtiofsd/fuse_lowlevel.h:238:
+^I * inodes lifetime must extend even beyond forget. See the$

ERROR: code indent should never use tabs
#2602: FILE: tools/virtiofsd/fuse_lowlevel.h:239:
+^I * generation field in struct fuse_entry_param above.$

ERROR: code indent should never use tabs
#2603: FILE: tools/virtiofsd/fuse_lowlevel.h:240:
+^I *$

ERROR: code indent should never use tabs
#2604: FILE: tools/virtiofsd/fuse_lowlevel.h:241:
+^I * On unmount the lookup count for all inodes implicitly drops$

ERROR: code indent should never use tabs
#2605: FILE: tools/virtiofsd/fuse_lowlevel.h:242:
+^I * to zero. It is not guaranteed that the file system will$

ERROR: code indent should never use tabs
#2606: FILE: tools/virtiofsd/fuse_lowlevel.h:243:
+^I * receive corresponding forget messages for the affected$

ERROR: code indent should never use tabs
#2607: FILE: tools/virtiofsd/fuse_lowlevel.h:244:
+^I * inodes.$

ERROR: code indent should never use tabs
#2608: FILE: tools/virtiofsd/fuse_lowlevel.h:245:
+^I *$

ERROR: code indent should never use tabs
#2609: FILE: tools/virtiofsd/fuse_lowlevel.h:246:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2610: FILE: tools/virtiofsd/fuse_lowlevel.h:247:
+^I * fuse_reply_none$

ERROR: code indent should never use tabs
#2611: FILE: tools/virtiofsd/fuse_lowlevel.h:248:
+^I *$

ERROR: code indent should never use tabs
#2612: FILE: tools/virtiofsd/fuse_lowlevel.h:249:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2613: FILE: tools/virtiofsd/fuse_lowlevel.h:250:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs #2614: FILE: tools/virtiofsd/fuse_lowlevel.h:251:
+^I * @param nlookup the number of lookups to forget$

ERROR: code indent should never use tabs
#2615: FILE: tools/virtiofsd/fuse_lowlevel.h:252:
+^I */$

ERROR: code indent should never use tabs
#2616: FILE: tools/virtiofsd/fuse_lowlevel.h:253:
+^Ivoid (*forget) (fuse_req_t req, fuse_ino_t ino, uint64_t nlookup);$

ERROR: code indent should never use tabs
#2618: FILE: tools/virtiofsd/fuse_lowlevel.h:255:
+^I/**$

ERROR: code indent should never use tabs
#2619: FILE: tools/virtiofsd/fuse_lowlevel.h:256:
+^I * Get file attributes.$

ERROR: code indent should never use tabs
#2620: FILE: tools/virtiofsd/fuse_lowlevel.h:257:
+^I *$

ERROR: code indent should never use tabs
#2621: FILE: tools/virtiofsd/fuse_lowlevel.h:258:
+^I * If writeback caching is enabled, the kernel may have a$

ERROR: code indent should never use tabs
#2622: FILE: tools/virtiofsd/fuse_lowlevel.h:259:
+^I * better idea of a file's length than the FUSE file system$

ERROR: code indent should never use tabs
#2623: FILE: tools/virtiofsd/fuse_lowlevel.h:260:
+^I * (eg if there has been a write that extended the file size,$

ERROR: code indent should never use tabs
#2624: FILE: tools/virtiofsd/fuse_lowlevel.h:261:
+^I * but that has not yet been passed to the filesystem.n$

ERROR: code indent should never use tabs
#2625: FILE: tools/virtiofsd/fuse_lowlevel.h:262:
+^I *$

ERROR: code indent should never use tabs
#2626: FILE: tools/virtiofsd/fuse_lowlevel.h:263:
+^I * In this case, the st_size value provided by the file system$

ERROR: code indent should never use tabs
#2627: FILE: tools/virtiofsd/fuse_lowlevel.h:264:
+^I * will be ignored.$

ERROR: code indent should never use tabs
#2628: FILE: tools/virtiofsd/fuse_lowlevel.h:265:
+^I *$

ERROR: code indent should never use tabs
#2629: FILE: tools/virtiofsd/fuse_lowlevel.h:266:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2630: FILE: tools/virtiofsd/fuse_lowlevel.h:267:
+^I * fuse_reply_attr$

ERROR: code indent should never use tabs
#2631: FILE: tools/virtiofsd/fuse_lowlevel.h:268:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2632: FILE: tools/virtiofsd/fuse_lowlevel.h:269:
+^I *$

ERROR: code indent should never use tabs
#2633: FILE: tools/virtiofsd/fuse_lowlevel.h:270:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2634: FILE: tools/virtiofsd/fuse_lowlevel.h:271:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs #2635: FILE: tools/virtiofsd/fuse_lowlevel.h:272:
+^I * @param fi for future use, currently always NULL$

ERROR: code indent should never use tabs
#2636: FILE: tools/virtiofsd/fuse_lowlevel.h:273:
+^I */$

ERROR: code indent should never use tabs #2637: FILE: tools/virtiofsd/fuse_lowlevel.h:274:
+^Ivoid (*getattr) (fuse_req_t req, fuse_ino_t ino,$

ERROR: code indent should never use tabs
#2638: FILE: tools/virtiofsd/fuse_lowlevel.h:275:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2640: FILE: tools/virtiofsd/fuse_lowlevel.h:277:
+^I/**$

ERROR: code indent should never use tabs
#2641: FILE: tools/virtiofsd/fuse_lowlevel.h:278:
+^I * Set file attributes$

ERROR: code indent should never use tabs
#2642: FILE: tools/virtiofsd/fuse_lowlevel.h:279:
+^I *$

ERROR: code indent should never use tabs
#2643: FILE: tools/virtiofsd/fuse_lowlevel.h:280:
+^I * In the 'attr' argument only members indicated by the 'to_set'$

ERROR: code indent should never use tabs
#2644: FILE: tools/virtiofsd/fuse_lowlevel.h:281:
+^I * bitmask contain valid values. Other members contain undefined$

ERROR: code indent should never use tabs
#2645: FILE: tools/virtiofsd/fuse_lowlevel.h:282:
+^I * values.$

ERROR: code indent should never use tabs
#2646: FILE: tools/virtiofsd/fuse_lowlevel.h:283:
+^I *$

ERROR: code indent should never use tabs
#2647: FILE: tools/virtiofsd/fuse_lowlevel.h:284:
+^I * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is$

ERROR: code indent should never use tabs
#2648: FILE: tools/virtiofsd/fuse_lowlevel.h:285:
+^I * expected to reset the setuid and setgid bits if the file$

ERROR: code indent should never use tabs
#2649: FILE: tools/virtiofsd/fuse_lowlevel.h:286:
+^I * size or owner is being changed.$

ERROR: code indent should never use tabs
#2650: FILE: tools/virtiofsd/fuse_lowlevel.h:287:
+^I *$

ERROR: code indent should never use tabs
#2651: FILE: tools/virtiofsd/fuse_lowlevel.h:288:
+^I * If the setattr was invoked from the ftruncate() system call$

ERROR: code indent should never use tabs
#2652: FILE: tools/virtiofsd/fuse_lowlevel.h:289:
+^I * under Linux kernel versions 2.6.15 or later, the fi->fh will$

ERROR: code indent should never use tabs
#2653: FILE: tools/virtiofsd/fuse_lowlevel.h:290:
+^I * contain the value set by the open method or will be undefined$

ERROR: code indent should never use tabs
#2654: FILE: tools/virtiofsd/fuse_lowlevel.h:291:
+^I * if the open method didn't set any value. Otherwise (not$

ERROR: code indent should never use tabs
#2655: FILE: tools/virtiofsd/fuse_lowlevel.h:292:
+^I * ftruncate call, or kernel version earlier than 2.6.15) the fi$

ERROR: code indent should never use tabs
#2656: FILE: tools/virtiofsd/fuse_lowlevel.h:293:
+^I * parameter will be NULL.$

ERROR: code indent should never use tabs
#2657: FILE: tools/virtiofsd/fuse_lowlevel.h:294:
+^I *$

ERROR: code indent should never use tabs
#2658: FILE: tools/virtiofsd/fuse_lowlevel.h:295:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2659: FILE: tools/virtiofsd/fuse_lowlevel.h:296:
+^I * fuse_reply_attr$

ERROR: code indent should never use tabs
#2660: FILE: tools/virtiofsd/fuse_lowlevel.h:297:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2661: FILE: tools/virtiofsd/fuse_lowlevel.h:298:
+^I *$

ERROR: code indent should never use tabs
#2662: FILE: tools/virtiofsd/fuse_lowlevel.h:299:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2663: FILE: tools/virtiofsd/fuse_lowlevel.h:300:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2664: FILE: tools/virtiofsd/fuse_lowlevel.h:301:
+^I * @param attr the attributes$

ERROR: code indent should never use tabs
#2665: FILE: tools/virtiofsd/fuse_lowlevel.h:302:
+^I * @param to_set bit mask of attributes which should be set$

ERROR: code indent should never use tabs
#2666: FILE: tools/virtiofsd/fuse_lowlevel.h:303:
+^I * @param fi file information, or NULL$

ERROR: code indent should never use tabs
#2667: FILE: tools/virtiofsd/fuse_lowlevel.h:304:
+^I */$

ERROR: code indent should never use tabs
#2668: FILE: tools/virtiofsd/fuse_lowlevel.h:305:
+^Ivoid (*setattr) (fuse_req_t req, fuse_ino_t ino, struct stat *attr,$

ERROR: code indent should never use tabs
#2669: FILE: tools/virtiofsd/fuse_lowlevel.h:306:
+^I^I^I int to_set, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2671: FILE: tools/virtiofsd/fuse_lowlevel.h:308:
+^I/**$

ERROR: code indent should never use tabs
#2672: FILE: tools/virtiofsd/fuse_lowlevel.h:309:
+^I * Read symbolic link$

ERROR: code indent should never use tabs
#2673: FILE: tools/virtiofsd/fuse_lowlevel.h:310:
+^I *$

ERROR: code indent should never use tabs
#2674: FILE: tools/virtiofsd/fuse_lowlevel.h:311:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2675: FILE: tools/virtiofsd/fuse_lowlevel.h:312:
+^I * fuse_reply_readlink$

ERROR: code indent should never use tabs
#2676: FILE: tools/virtiofsd/fuse_lowlevel.h:313:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2677: FILE: tools/virtiofsd/fuse_lowlevel.h:314:
+^I *$

ERROR: code indent should never use tabs
#2678: FILE: tools/virtiofsd/fuse_lowlevel.h:315:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2679: FILE: tools/virtiofsd/fuse_lowlevel.h:316:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2680: FILE: tools/virtiofsd/fuse_lowlevel.h:317:
+^I */$

ERROR: code indent should never use tabs #2681: FILE: tools/virtiofsd/fuse_lowlevel.h:318:
+^Ivoid (*readlink) (fuse_req_t req, fuse_ino_t ino);$

ERROR: code indent should never use tabs
#2683: FILE: tools/virtiofsd/fuse_lowlevel.h:320:
+^I/**$

ERROR: code indent should never use tabs
#2684: FILE: tools/virtiofsd/fuse_lowlevel.h:321:
+^I * Create file node$

ERROR: code indent should never use tabs
#2685: FILE: tools/virtiofsd/fuse_lowlevel.h:322:
+^I *$

ERROR: code indent should never use tabs
#2686: FILE: tools/virtiofsd/fuse_lowlevel.h:323:
+^I * Create a regular file, character device, block device, fifo or$

ERROR: code indent should never use tabs
#2687: FILE: tools/virtiofsd/fuse_lowlevel.h:324:
+^I * socket node.$

ERROR: code indent should never use tabs
#2688: FILE: tools/virtiofsd/fuse_lowlevel.h:325:
+^I *$

ERROR: code indent should never use tabs
#2689: FILE: tools/virtiofsd/fuse_lowlevel.h:326:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2690: FILE: tools/virtiofsd/fuse_lowlevel.h:327:
+^I * fuse_reply_entry$

ERROR: code indent should never use tabs
#2691: FILE: tools/virtiofsd/fuse_lowlevel.h:328:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2692: FILE: tools/virtiofsd/fuse_lowlevel.h:329:
+^I *$

ERROR: code indent should never use tabs
#2693: FILE: tools/virtiofsd/fuse_lowlevel.h:330:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2694: FILE: tools/virtiofsd/fuse_lowlevel.h:331:
+^I * @param parent inode number of the parent directory$

ERROR: code indent should never use tabs
#2695: FILE: tools/virtiofsd/fuse_lowlevel.h:332:
+^I * @param name to create$

ERROR: code indent should never use tabs
#2696: FILE: tools/virtiofsd/fuse_lowlevel.h:333:
+^I * @param mode file type and mode with which to create the new file$

WARNING: line over 80 characters
#2697: FILE: tools/virtiofsd/fuse_lowlevel.h:334:
+ * @param rdev the device number (only valid if created file is a device)

ERROR: code indent should never use tabs
#2697: FILE: tools/virtiofsd/fuse_lowlevel.h:334:
+^I * @param rdev the device number (only valid if created file is a device)$

ERROR: code indent should never use tabs
#2698: FILE: tools/virtiofsd/fuse_lowlevel.h:335:
+^I */$

ERROR: code indent should never use tabs
#2699: FILE: tools/virtiofsd/fuse_lowlevel.h:336:
+^Ivoid (*mknod) (fuse_req_t req, fuse_ino_t parent, const char *name,$

ERROR: code indent should never use tabs
#2700: FILE: tools/virtiofsd/fuse_lowlevel.h:337:
+^I^I mode_t mode, dev_t rdev);$

ERROR: code indent should never use tabs
#2702: FILE: tools/virtiofsd/fuse_lowlevel.h:339:
+^I/**$

ERROR: code indent should never use tabs
#2703: FILE: tools/virtiofsd/fuse_lowlevel.h:340:
+^I * Create a directory$

ERROR: code indent should never use tabs
#2704: FILE: tools/virtiofsd/fuse_lowlevel.h:341:
+^I *$

ERROR: code indent should never use tabs
#2705: FILE: tools/virtiofsd/fuse_lowlevel.h:342:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2706: FILE: tools/virtiofsd/fuse_lowlevel.h:343:
+^I * fuse_reply_entry$

ERROR: code indent should never use tabs
#2707: FILE: tools/virtiofsd/fuse_lowlevel.h:344:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2708: FILE: tools/virtiofsd/fuse_lowlevel.h:345:
+^I *$

ERROR: code indent should never use tabs
#2709: FILE: tools/virtiofsd/fuse_lowlevel.h:346:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2710: FILE: tools/virtiofsd/fuse_lowlevel.h:347:
+^I * @param parent inode number of the parent directory$

ERROR: code indent should never use tabs
#2711: FILE: tools/virtiofsd/fuse_lowlevel.h:348:
+^I * @param name to create$

ERROR: code indent should never use tabs #2712: FILE: tools/virtiofsd/fuse_lowlevel.h:349:
+^I * @param mode with which to create the new file$

ERROR: code indent should never use tabs
#2713: FILE: tools/virtiofsd/fuse_lowlevel.h:350:
+^I */$

ERROR: code indent should never use tabs
#2714: FILE: tools/virtiofsd/fuse_lowlevel.h:351:
+^Ivoid (*mkdir) (fuse_req_t req, fuse_ino_t parent, const char *name,$

ERROR: code indent should never use tabs
#2715: FILE: tools/virtiofsd/fuse_lowlevel.h:352:
+^I^I mode_t mode);$

ERROR: code indent should never use tabs
#2717: FILE: tools/virtiofsd/fuse_lowlevel.h:354:
+^I/**$

ERROR: code indent should never use tabs
#2718: FILE: tools/virtiofsd/fuse_lowlevel.h:355:
+^I * Remove a file$

ERROR: code indent should never use tabs
#2719: FILE: tools/virtiofsd/fuse_lowlevel.h:356:
+^I *$

ERROR: code indent should never use tabs
#2720: FILE: tools/virtiofsd/fuse_lowlevel.h:357:
+^I * If the file's inode's lookup count is non-zero, the file$

ERROR: code indent should never use tabs
#2721: FILE: tools/virtiofsd/fuse_lowlevel.h:358:
+^I * system is expected to postpone any removal of the inode$

ERROR: code indent should never use tabs
#2722: FILE: tools/virtiofsd/fuse_lowlevel.h:359:
+^I * until the lookup count reaches zero (see description of the$

ERROR: code indent should never use tabs
#2723: FILE: tools/virtiofsd/fuse_lowlevel.h:360:
+^I * forget function).$

ERROR: code indent should never use tabs
#2724: FILE: tools/virtiofsd/fuse_lowlevel.h:361:
+^I *$

ERROR: code indent should never use tabs
#2725: FILE: tools/virtiofsd/fuse_lowlevel.h:362:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2726: FILE: tools/virtiofsd/fuse_lowlevel.h:363:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2727: FILE: tools/virtiofsd/fuse_lowlevel.h:364:
+^I *$

ERROR: code indent should never use tabs
#2728: FILE: tools/virtiofsd/fuse_lowlevel.h:365:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2729: FILE: tools/virtiofsd/fuse_lowlevel.h:366:
+^I * @param parent inode number of the parent directory$

ERROR: code indent should never use tabs
#2730: FILE: tools/virtiofsd/fuse_lowlevel.h:367:
+^I * @param name to remove$

ERROR: code indent should never use tabs
#2731: FILE: tools/virtiofsd/fuse_lowlevel.h:368:
+^I */$

ERROR: code indent should never use tabs
#2732: FILE: tools/virtiofsd/fuse_lowlevel.h:369:
+^Ivoid (*unlink) (fuse_req_t req, fuse_ino_t parent, const char *name);$

ERROR: code indent should never use tabs
#2734: FILE: tools/virtiofsd/fuse_lowlevel.h:371:
+^I/**$

ERROR: code indent should never use tabs
#2735: FILE: tools/virtiofsd/fuse_lowlevel.h:372:
+^I * Remove a directory$

ERROR: code indent should never use tabs
#2736: FILE: tools/virtiofsd/fuse_lowlevel.h:373:
+^I *$

ERROR: code indent should never use tabs
#2737: FILE: tools/virtiofsd/fuse_lowlevel.h:374:
+^I * If the directory's inode's lookup count is non-zero, the$

ERROR: code indent should never use tabs
#2738: FILE: tools/virtiofsd/fuse_lowlevel.h:375:
+^I * file system is expected to postpone any removal of the$

ERROR: code indent should never use tabs
#2739: FILE: tools/virtiofsd/fuse_lowlevel.h:376:
+^I * inode until the lookup count reaches zero (see description$

ERROR: code indent should never use tabs
#2740: FILE: tools/virtiofsd/fuse_lowlevel.h:377:
+^I * of the forget function).$

ERROR: code indent should never use tabs
#2741: FILE: tools/virtiofsd/fuse_lowlevel.h:378:
+^I *$

ERROR: code indent should never use tabs
#2742: FILE: tools/virtiofsd/fuse_lowlevel.h:379:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2743: FILE: tools/virtiofsd/fuse_lowlevel.h:380:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2744: FILE: tools/virtiofsd/fuse_lowlevel.h:381:
+^I *$

ERROR: code indent should never use tabs
#2745: FILE: tools/virtiofsd/fuse_lowlevel.h:382:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2746: FILE: tools/virtiofsd/fuse_lowlevel.h:383:
+^I * @param parent inode number of the parent directory$

ERROR: code indent should never use tabs
#2747: FILE: tools/virtiofsd/fuse_lowlevel.h:384:
+^I * @param name to remove$

ERROR: code indent should never use tabs
#2748: FILE: tools/virtiofsd/fuse_lowlevel.h:385:
+^I */$

ERROR: code indent should never use tabs
#2749: FILE: tools/virtiofsd/fuse_lowlevel.h:386:
+^Ivoid (*rmdir) (fuse_req_t req, fuse_ino_t parent, const char *name);$

ERROR: code indent should never use tabs
#2751: FILE: tools/virtiofsd/fuse_lowlevel.h:388:
+^I/**$

ERROR: code indent should never use tabs
#2752: FILE: tools/virtiofsd/fuse_lowlevel.h:389:
+^I * Create a symbolic link$

ERROR: code indent should never use tabs
#2753: FILE: tools/virtiofsd/fuse_lowlevel.h:390:
+^I *$

ERROR: code indent should never use tabs
#2754: FILE: tools/virtiofsd/fuse_lowlevel.h:391:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2755: FILE: tools/virtiofsd/fuse_lowlevel.h:392:
+^I * fuse_reply_entry$

ERROR: code indent should never use tabs
#2756: FILE: tools/virtiofsd/fuse_lowlevel.h:393:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2757: FILE: tools/virtiofsd/fuse_lowlevel.h:394:
+^I *$

ERROR: code indent should never use tabs
#2758: FILE: tools/virtiofsd/fuse_lowlevel.h:395:
+^I * @param req request handle$

ERROR: code indent should never use tabs #2759: FILE: tools/virtiofsd/fuse_lowlevel.h:396:
+^I * @param link the contents of the symbolic link$

ERROR: code indent should never use tabs
#2760: FILE: tools/virtiofsd/fuse_lowlevel.h:397:
+^I * @param parent inode number of the parent directory$

ERROR: code indent should never use tabs
#2761: FILE: tools/virtiofsd/fuse_lowlevel.h:398:
+^I * @param name to create$

ERROR: code indent should never use tabs
#2762: FILE: tools/virtiofsd/fuse_lowlevel.h:399:
+^I */$

ERROR: code indent should never use tabs
#2763: FILE: tools/virtiofsd/fuse_lowlevel.h:400:
+^Ivoid (*symlink) (fuse_req_t req, const char *link, fuse_ino_t parent,$

ERROR: code indent should never use tabs
#2764: FILE: tools/virtiofsd/fuse_lowlevel.h:401:
+^I^I^I const char *name);$

ERROR: code indent should never use tabs
#2766: FILE: tools/virtiofsd/fuse_lowlevel.h:403:
+^I/** Rename a file$

WARNING: Block comments use a leading /* on a separate line #2766: FILE: tools/virtiofsd/fuse_lowlevel.h:403:
+ /** Rename a file

ERROR: code indent should never use tabs
#2767: FILE: tools/virtiofsd/fuse_lowlevel.h:404:
+^I *$

ERROR: code indent should never use tabs
#2768: FILE: tools/virtiofsd/fuse_lowlevel.h:405:
+^I * If the target exists it should be atomically replaced. If$

ERROR: code indent should never use tabs
#2769: FILE: tools/virtiofsd/fuse_lowlevel.h:406:
+^I * the target's inode's lookup count is non-zero, the file$

ERROR: code indent should never use tabs
#2770: FILE: tools/virtiofsd/fuse_lowlevel.h:407:
+^I * system is expected to postpone any removal of the inode$

ERROR: code indent should never use tabs
#2771: FILE: tools/virtiofsd/fuse_lowlevel.h:408:
+^I * until the lookup count reaches zero (see description of the$

ERROR: code indent should never use tabs
#2772: FILE: tools/virtiofsd/fuse_lowlevel.h:409:
+^I * forget function).$

ERROR: code indent should never use tabs
#2773: FILE: tools/virtiofsd/fuse_lowlevel.h:410:
+^I *$

ERROR: code indent should never use tabs
#2774: FILE: tools/virtiofsd/fuse_lowlevel.h:411:
+^I * If this request is answered with an error code of ENOSYS, this is$

ERROR: code indent should never use tabs
#2775: FILE: tools/virtiofsd/fuse_lowlevel.h:412:
+^I * treated as a permanent failure with error code EINVAL, i.e. all$

ERROR: code indent should never use tabs
#2776: FILE: tools/virtiofsd/fuse_lowlevel.h:413:
+^I * future bmap requests will fail with EINVAL without being$

ERROR: code indent should never use tabs
#2777: FILE: tools/virtiofsd/fuse_lowlevel.h:414:
+^I * send to the filesystem process.$

ERROR: code indent should never use tabs
#2778: FILE: tools/virtiofsd/fuse_lowlevel.h:415:
+^I *$

ERROR: code indent should never use tabs
#2779: FILE: tools/virtiofsd/fuse_lowlevel.h:416:
+^I * *flags* may be RENAME_EXCHANGE or RENAME_NOREPLACE. If$

ERROR: code indent should never use tabs
#2780: FILE: tools/virtiofsd/fuse_lowlevel.h:417:
+^I * RENAME_NOREPLACE is specified, the filesystem must not$

ERROR: code indent should never use tabs
#2781: FILE: tools/virtiofsd/fuse_lowlevel.h:418:
+^I * overwrite *newname* if it exists and return an error$

ERROR: code indent should never use tabs
#2782: FILE: tools/virtiofsd/fuse_lowlevel.h:419:
+^I * instead. If RENAME_EXCHANGE is specified, the filesystem$

ERROR: code indent should never use tabs
#2783: FILE: tools/virtiofsd/fuse_lowlevel.h:420:
+^I * must atomically exchange the two files, i.e. both must$

ERROR: code indent should never use tabs
#2784: FILE: tools/virtiofsd/fuse_lowlevel.h:421:
+^I * exist and neither may be deleted.$

ERROR: code indent should never use tabs
#2785: FILE: tools/virtiofsd/fuse_lowlevel.h:422:
+^I *$

ERROR: code indent should never use tabs
#2786: FILE: tools/virtiofsd/fuse_lowlevel.h:423:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2787: FILE: tools/virtiofsd/fuse_lowlevel.h:424:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2788: FILE: tools/virtiofsd/fuse_lowlevel.h:425:
+^I *$

ERROR: code indent should never use tabs
#2789: FILE: tools/virtiofsd/fuse_lowlevel.h:426:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2790: FILE: tools/virtiofsd/fuse_lowlevel.h:427:
+^I * @param parent inode number of the old parent directory$

ERROR: code indent should never use tabs
#2791: FILE: tools/virtiofsd/fuse_lowlevel.h:428:
+^I * @param name old name$

ERROR: code indent should never use tabs
#2792: FILE: tools/virtiofsd/fuse_lowlevel.h:429:
+^I * @param newparent inode number of the new parent directory$

ERROR: code indent should never use tabs
#2793: FILE: tools/virtiofsd/fuse_lowlevel.h:430:
+^I * @param newname new name$

ERROR: code indent should never use tabs
#2794: FILE: tools/virtiofsd/fuse_lowlevel.h:431:
+^I */$

ERROR: code indent should never use tabs
#2795: FILE: tools/virtiofsd/fuse_lowlevel.h:432:
+^Ivoid (*rename) (fuse_req_t req, fuse_ino_t parent, const char *name,$

ERROR: code indent should never use tabs #2796: FILE: tools/virtiofsd/fuse_lowlevel.h:433:
+^I^I^Ifuse_ino_t newparent, const char *newname,$

ERROR: code indent should never use tabs
#2797: FILE: tools/virtiofsd/fuse_lowlevel.h:434:
+^I^I^Iunsigned int flags);$

ERROR: code indent should never use tabs
#2799: FILE: tools/virtiofsd/fuse_lowlevel.h:436:
+^I/**$

ERROR: code indent should never use tabs
#2800: FILE: tools/virtiofsd/fuse_lowlevel.h:437:
+^I * Create a hard link$

ERROR: code indent should never use tabs
#2801: FILE: tools/virtiofsd/fuse_lowlevel.h:438:
+^I *$

ERROR: code indent should never use tabs
#2802: FILE: tools/virtiofsd/fuse_lowlevel.h:439:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2803: FILE: tools/virtiofsd/fuse_lowlevel.h:440:
+^I * fuse_reply_entry$

ERROR: code indent should never use tabs
#2804: FILE: tools/virtiofsd/fuse_lowlevel.h:441:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2805: FILE: tools/virtiofsd/fuse_lowlevel.h:442:
+^I *$

ERROR: code indent should never use tabs
#2806: FILE: tools/virtiofsd/fuse_lowlevel.h:443:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2807: FILE: tools/virtiofsd/fuse_lowlevel.h:444:
+^I * @param ino the old inode number$

ERROR: code indent should never use tabs
#2808: FILE: tools/virtiofsd/fuse_lowlevel.h:445:
+^I * @param newparent inode number of the new parent directory$

ERROR: code indent should never use tabs
#2809: FILE: tools/virtiofsd/fuse_lowlevel.h:446:
+^I * @param newname new name to create$

ERROR: code indent should never use tabs
#2810: FILE: tools/virtiofsd/fuse_lowlevel.h:447:
+^I */$

ERROR: code indent should never use tabs
#2811: FILE: tools/virtiofsd/fuse_lowlevel.h:448:
+^Ivoid (*link) (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent,$

ERROR: code indent should never use tabs
#2812: FILE: tools/virtiofsd/fuse_lowlevel.h:449:
+^I^I const char *newname);$

ERROR: code indent should never use tabs
#2814: FILE: tools/virtiofsd/fuse_lowlevel.h:451:
+^I/**$

ERROR: code indent should never use tabs
#2815: FILE: tools/virtiofsd/fuse_lowlevel.h:452:
+^I * Open a file$

ERROR: code indent should never use tabs
#2816: FILE: tools/virtiofsd/fuse_lowlevel.h:453:
+^I *$

ERROR: code indent should never use tabs
#2817: FILE: tools/virtiofsd/fuse_lowlevel.h:454:
+^I * Open flags are available in fi->flags. The following rules$

ERROR: code indent should never use tabs
#2818: FILE: tools/virtiofsd/fuse_lowlevel.h:455:
+^I * apply.$

ERROR: code indent should never use tabs
#2819: FILE: tools/virtiofsd/fuse_lowlevel.h:456:
+^I *$

ERROR: code indent should never use tabs
#2820: FILE: tools/virtiofsd/fuse_lowlevel.h:457:
+^I * - Creation (O_CREAT, O_EXCL, O_NOCTTY) flags will be$

ERROR: code indent should never use tabs
#2821: FILE: tools/virtiofsd/fuse_lowlevel.h:458:
+^I * filtered out / handled by the kernel.$

ERROR: code indent should never use tabs
#2822: FILE: tools/virtiofsd/fuse_lowlevel.h:459:
+^I *$

ERROR: code indent should never use tabs
#2823: FILE: tools/virtiofsd/fuse_lowlevel.h:460:
+^I * - Access modes (O_RDONLY, O_WRONLY, O_RDWR) should be used$

ERROR: code indent should never use tabs
#2824: FILE: tools/virtiofsd/fuse_lowlevel.h:461:
+^I * by the filesystem to check if the operation is$

ERROR: code indent should never use tabs
#2825: FILE: tools/virtiofsd/fuse_lowlevel.h:462:
+^I * permitted. If the ``-o default_permissions`` mount$

ERROR: code indent should never use tabs
#2826: FILE: tools/virtiofsd/fuse_lowlevel.h:463:
+^I * option is given, this check is already done by the$

ERROR: code indent should never use tabs
#2827: FILE: tools/virtiofsd/fuse_lowlevel.h:464:
+^I * kernel before calling open() and may thus be omitted by$

ERROR: code indent should never use tabs
#2828: FILE: tools/virtiofsd/fuse_lowlevel.h:465:
+^I * the filesystem.$

ERROR: code indent should never use tabs
#2829: FILE: tools/virtiofsd/fuse_lowlevel.h:466:
+^I *$

ERROR: code indent should never use tabs
#2830: FILE: tools/virtiofsd/fuse_lowlevel.h:467:
+^I * - When writeback caching is enabled, the kernel may send$

ERROR: code indent should never use tabs
#2831: FILE: tools/virtiofsd/fuse_lowlevel.h:468:
+^I * read requests even for files opened with O_WRONLY. The$

ERROR: code indent should never use tabs
#2832: FILE: tools/virtiofsd/fuse_lowlevel.h:469:
+^I * filesystem should be prepared to handle this.$

ERROR: code indent should never use tabs
#2833: FILE: tools/virtiofsd/fuse_lowlevel.h:470:
+^I *$

ERROR: code indent should never use tabs
#2834: FILE: tools/virtiofsd/fuse_lowlevel.h:471:
+^I * - When writeback caching is disabled, the filesystem is$

ERROR: code indent should never use tabs
#2835: FILE: tools/virtiofsd/fuse_lowlevel.h:472:
+^I * expected to properly handle the O_APPEND flag and ensure$

ERROR: code indent should never use tabs
#2836: FILE: tools/virtiofsd/fuse_lowlevel.h:473:
+^I * that each write is appending to the end of the file.$

ERROR: trailing whitespace
#2837: FILE: tools/virtiofsd/fuse_lowlevel.h:474:
+^I * $

ERROR: code indent should never use tabs
#2837: FILE: tools/virtiofsd/fuse_lowlevel.h:474:
+^I * $

ERROR: code indent should never use tabs
#2839: FILE: tools/virtiofsd/fuse_lowlevel.h:476:
+^I * handle O_APPEND. However, unless all changes to the file$

ERROR: code indent should never use tabs
#2840: FILE: tools/virtiofsd/fuse_lowlevel.h:477:
+^I * come through the kernel this will not work reliably. The$

ERROR: code indent should never use tabs
#2841: FILE: tools/virtiofsd/fuse_lowlevel.h:478:
+^I * filesystem should thus either ignore the O_APPEND flag$

ERROR: code indent should never use tabs
#2842: FILE: tools/virtiofsd/fuse_lowlevel.h:479:
+^I * (and let the kernel handle it), or return an error$

ERROR: code indent should never use tabs
#2843: FILE: tools/virtiofsd/fuse_lowlevel.h:480:
+^I * (indicating that reliably O_APPEND is not available).$

ERROR: code indent should never use tabs
#2844: FILE: tools/virtiofsd/fuse_lowlevel.h:481:
+^I *$

ERROR: code indent should never use tabs
#2845: FILE: tools/virtiofsd/fuse_lowlevel.h:482:
+^I * Filesystem may store an arbitrary file handle (pointer,$

ERROR: code indent should never use tabs
#2846: FILE: tools/virtiofsd/fuse_lowlevel.h:483:
+^I * index, etc) in fi->fh, and use this in other all other file$

ERROR: code indent should never use tabs #2847: FILE: tools/virtiofsd/fuse_lowlevel.h:484:
+^I * operations (read, write, flush, release, fsync).$

ERROR: code indent should never use tabs
#2848: FILE: tools/virtiofsd/fuse_lowlevel.h:485:
+^I *$

ERROR: code indent should never use tabs
#2849: FILE: tools/virtiofsd/fuse_lowlevel.h:486:
+^I * Filesystem may also implement stateless file I/O and not store$

ERROR: code indent should never use tabs
#2850: FILE: tools/virtiofsd/fuse_lowlevel.h:487:
+^I * anything in fi->fh.$

ERROR: code indent should never use tabs
#2851: FILE: tools/virtiofsd/fuse_lowlevel.h:488:
+^I *$

ERROR: code indent should never use tabs
#2852: FILE: tools/virtiofsd/fuse_lowlevel.h:489:
+^I * There are also some flags (direct_io, keep_cache) which the$

ERROR: code indent should never use tabs
#2853: FILE: tools/virtiofsd/fuse_lowlevel.h:490:
+^I * filesystem may set in fi, to change the way the file is opened.$

ERROR: code indent should never use tabs
#2854: FILE: tools/virtiofsd/fuse_lowlevel.h:491:
+^I * See fuse_file_info structure in <fuse_common.h> for more details.$

ERROR: code indent should never use tabs
#2855: FILE: tools/virtiofsd/fuse_lowlevel.h:492:
+^I *$

ERROR: code indent should never use tabs
#2856: FILE: tools/virtiofsd/fuse_lowlevel.h:493:
+^I * If this request is answered with an error code of ENOSYS$

ERROR: code indent should never use tabs
#2857: FILE: tools/virtiofsd/fuse_lowlevel.h:494:
+^I * and FUSE_CAP_NO_OPEN_SUPPORT is set in$

ERROR: code indent should never use tabs
#2858: FILE: tools/virtiofsd/fuse_lowlevel.h:495:
+^I * fuse_conn_info.capable, this is treated as success and$

ERROR: code indent should never use tabs
#2859: FILE: tools/virtiofsd/fuse_lowlevel.h:496:
+^I * future calls to open and release will also succeed without being$

ERROR: code indent should never use tabs
#2860: FILE: tools/virtiofsd/fuse_lowlevel.h:497:
+^I * sent to the filesystem process.$

ERROR: code indent should never use tabs
#2861: FILE: tools/virtiofsd/fuse_lowlevel.h:498:
+^I *$

ERROR: code indent should never use tabs
#2862: FILE: tools/virtiofsd/fuse_lowlevel.h:499:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2863: FILE: tools/virtiofsd/fuse_lowlevel.h:500:
+^I * fuse_reply_open$

ERROR: code indent should never use tabs
#2864: FILE: tools/virtiofsd/fuse_lowlevel.h:501:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2865: FILE: tools/virtiofsd/fuse_lowlevel.h:502:
+^I *$

ERROR: code indent should never use tabs
#2866: FILE: tools/virtiofsd/fuse_lowlevel.h:503:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2867: FILE: tools/virtiofsd/fuse_lowlevel.h:504:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2868: FILE: tools/virtiofsd/fuse_lowlevel.h:505:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#2869: FILE: tools/virtiofsd/fuse_lowlevel.h:506:
+^I */$

ERROR: code indent should never use tabs
#2870: FILE: tools/virtiofsd/fuse_lowlevel.h:507:
+^Ivoid (*open) (fuse_req_t req, fuse_ino_t ino,$

ERROR: code indent should never use tabs
#2871: FILE: tools/virtiofsd/fuse_lowlevel.h:508:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2873: FILE: tools/virtiofsd/fuse_lowlevel.h:510:
+^I/**$

ERROR: code indent should never use tabs
#2874: FILE: tools/virtiofsd/fuse_lowlevel.h:511:
+^I * Read data$

ERROR: code indent should never use tabs
#2875: FILE: tools/virtiofsd/fuse_lowlevel.h:512:
+^I *$

ERROR: code indent should never use tabs
#2876: FILE: tools/virtiofsd/fuse_lowlevel.h:513:
+^I * Read should send exactly the number of bytes requested except$

ERROR: code indent should never use tabs
#2877: FILE: tools/virtiofsd/fuse_lowlevel.h:514:
+^I * on EOF or error, otherwise the rest of the data will be$

ERROR: code indent should never use tabs
#2878: FILE: tools/virtiofsd/fuse_lowlevel.h:515:
+^I * substituted with zeroes. An exception to this is when the file$

ERROR: code indent should never use tabs
#2879: FILE: tools/virtiofsd/fuse_lowlevel.h:516:
+^I * has been opened in 'direct_io' mode, in which case the return$

ERROR: code indent should never use tabs
#2880: FILE: tools/virtiofsd/fuse_lowlevel.h:517:
+^I * value of the read system call will reflect the return value of$

ERROR: code indent should never use tabs
#2881: FILE: tools/virtiofsd/fuse_lowlevel.h:518:
+^I * this operation.$

ERROR: code indent should never use tabs
#2882: FILE: tools/virtiofsd/fuse_lowlevel.h:519:
+^I *$

ERROR: code indent should never use tabs
#2883: FILE: tools/virtiofsd/fuse_lowlevel.h:520:
+^I * fi->fh will contain the value set by the open method, or will$

ERROR: code indent should never use tabs
#2884: FILE: tools/virtiofsd/fuse_lowlevel.h:521:
+^I * be undefined if the open method didn't set any value.$

ERROR: code indent should never use tabs
#2885: FILE: tools/virtiofsd/fuse_lowlevel.h:522:
+^I *$

ERROR: code indent should never use tabs
#2886: FILE: tools/virtiofsd/fuse_lowlevel.h:523:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2887: FILE: tools/virtiofsd/fuse_lowlevel.h:524:
+^I * fuse_reply_buf$

ERROR: code indent should never use tabs
#2888: FILE: tools/virtiofsd/fuse_lowlevel.h:525:
+^I * fuse_reply_iov$

ERROR: code indent should never use tabs
#2889: FILE: tools/virtiofsd/fuse_lowlevel.h:526:
+^I * fuse_reply_data$

ERROR: code indent should never use tabs
#2890: FILE: tools/virtiofsd/fuse_lowlevel.h:527:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2891: FILE: tools/virtiofsd/fuse_lowlevel.h:528:
+^I *$

ERROR: code indent should never use tabs
#2892: FILE: tools/virtiofsd/fuse_lowlevel.h:529:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2893: FILE: tools/virtiofsd/fuse_lowlevel.h:530:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2894: FILE: tools/virtiofsd/fuse_lowlevel.h:531:
+^I * @param size number of bytes to read$

ERROR: code indent should never use tabs
#2895: FILE: tools/virtiofsd/fuse_lowlevel.h:532:
+^I * @param off offset to read from$

ERROR: code indent should never use tabs
#2896: FILE: tools/virtiofsd/fuse_lowlevel.h:533:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#2897: FILE: tools/virtiofsd/fuse_lowlevel.h:534:
+^I */$

ERROR: code indent should never use tabs
#2898: FILE: tools/virtiofsd/fuse_lowlevel.h:535:
+^Ivoid (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,$

ERROR: code indent should never use tabs
#2899: FILE: tools/virtiofsd/fuse_lowlevel.h:536:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2901: FILE: tools/virtiofsd/fuse_lowlevel.h:538:
+^I/**$

ERROR: code indent should never use tabs
#2902: FILE: tools/virtiofsd/fuse_lowlevel.h:539:
+^I * Write data$

ERROR: code indent should never use tabs
#2903: FILE: tools/virtiofsd/fuse_lowlevel.h:540:
+^I *$

ERROR: code indent should never use tabs
#2904: FILE: tools/virtiofsd/fuse_lowlevel.h:541:
+^I * Write should return exactly the number of bytes requested$

ERROR: code indent should never use tabs
#2905: FILE: tools/virtiofsd/fuse_lowlevel.h:542:
+^I * except on error. An exception to this is when the file has$

ERROR: code indent should never use tabs
#2906: FILE: tools/virtiofsd/fuse_lowlevel.h:543:
+^I * been opened in 'direct_io' mode, in which case the return value$

ERROR: code indent should never use tabs
#2907: FILE: tools/virtiofsd/fuse_lowlevel.h:544:
+^I * of the write system call will reflect the return value of this$

ERROR: code indent should never use tabs
#2908: FILE: tools/virtiofsd/fuse_lowlevel.h:545:
+^I * operation.$

ERROR: code indent should never use tabs
#2909: FILE: tools/virtiofsd/fuse_lowlevel.h:546:
+^I *$

ERROR: code indent should never use tabs
#2910: FILE: tools/virtiofsd/fuse_lowlevel.h:547:
+^I * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is$

ERROR: code indent should never use tabs #2911: FILE: tools/virtiofsd/fuse_lowlevel.h:548:
+^I * expected to reset the setuid and setgid bits.$

ERROR: code indent should never use tabs
#2912: FILE: tools/virtiofsd/fuse_lowlevel.h:549:
+^I *$

ERROR: code indent should never use tabs
#2913: FILE: tools/virtiofsd/fuse_lowlevel.h:550:
+^I * fi->fh will contain the value set by the open method, or will$

ERROR: code indent should never use tabs
#2914: FILE: tools/virtiofsd/fuse_lowlevel.h:551:
+^I * be undefined if the open method didn't set any value.$

ERROR: code indent should never use tabs
#2915: FILE: tools/virtiofsd/fuse_lowlevel.h:552:
+^I *$

ERROR: code indent should never use tabs
#2916: FILE: tools/virtiofsd/fuse_lowlevel.h:553:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2917: FILE: tools/virtiofsd/fuse_lowlevel.h:554:
+^I * fuse_reply_write$

ERROR: code indent should never use tabs
#2918: FILE: tools/virtiofsd/fuse_lowlevel.h:555:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2919: FILE: tools/virtiofsd/fuse_lowlevel.h:556:
+^I *$

ERROR: code indent should never use tabs
#2920: FILE: tools/virtiofsd/fuse_lowlevel.h:557:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2921: FILE: tools/virtiofsd/fuse_lowlevel.h:558:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2922: FILE: tools/virtiofsd/fuse_lowlevel.h:559:
+^I * @param buf data to write$

ERROR: code indent should never use tabs
#2923: FILE: tools/virtiofsd/fuse_lowlevel.h:560:
+^I * @param size number of bytes to write$

ERROR: code indent should never use tabs
#2924: FILE: tools/virtiofsd/fuse_lowlevel.h:561:
+^I * @param off offset to write to$

ERROR: code indent should never use tabs
#2925: FILE: tools/virtiofsd/fuse_lowlevel.h:562:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#2926: FILE: tools/virtiofsd/fuse_lowlevel.h:563:
+^I */$

ERROR: code indent should never use tabs
#2927: FILE: tools/virtiofsd/fuse_lowlevel.h:564:
+^Ivoid (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf,$

ERROR: code indent should never use tabs
#2928: FILE: tools/virtiofsd/fuse_lowlevel.h:565:
+^I^I size_t size, off_t off, struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2930: FILE: tools/virtiofsd/fuse_lowlevel.h:567:
+^I/**$

ERROR: code indent should never use tabs
#2931: FILE: tools/virtiofsd/fuse_lowlevel.h:568:
+^I * Flush method$

ERROR: code indent should never use tabs
#2932: FILE: tools/virtiofsd/fuse_lowlevel.h:569:
+^I *$

ERROR: code indent should never use tabs
#2933: FILE: tools/virtiofsd/fuse_lowlevel.h:570:
+^I * This is called on each close() of the opened file.$

ERROR: code indent should never use tabs
#2934: FILE: tools/virtiofsd/fuse_lowlevel.h:571:
+^I *$

ERROR: code indent should never use tabs
#2935: FILE: tools/virtiofsd/fuse_lowlevel.h:572:
+^I * Since file descriptors can be duplicated (dup, dup2, fork), for$

ERROR: code indent should never use tabs #2936: FILE: tools/virtiofsd/fuse_lowlevel.h:573:
+^I * one open call there may be many flush calls.$

ERROR: code indent should never use tabs
#2937: FILE: tools/virtiofsd/fuse_lowlevel.h:574:
+^I *$

ERROR: code indent should never use tabs
#2938: FILE: tools/virtiofsd/fuse_lowlevel.h:575:
+^I * Filesystems shouldn't assume that flush will always be called$

ERROR: code indent should never use tabs
#2939: FILE: tools/virtiofsd/fuse_lowlevel.h:576:
+^I * after some writes, or that if will be called at all.$

ERROR: code indent should never use tabs
#2940: FILE: tools/virtiofsd/fuse_lowlevel.h:577:
+^I *$

ERROR: code indent should never use tabs
#2941: FILE: tools/virtiofsd/fuse_lowlevel.h:578:
+^I * fi->fh will contain the value set by the open method, or will$

ERROR: code indent should never use tabs
#2942: FILE: tools/virtiofsd/fuse_lowlevel.h:579:
+^I * be undefined if the open method didn't set any value.$

ERROR: code indent should never use tabs
#2943: FILE: tools/virtiofsd/fuse_lowlevel.h:580:
+^I *$

ERROR: code indent should never use tabs
#2944: FILE: tools/virtiofsd/fuse_lowlevel.h:581:
+^I * NOTE: the name of the method is misleading, since (unlike$

ERROR: code indent should never use tabs
#2945: FILE: tools/virtiofsd/fuse_lowlevel.h:582:
+^I * fsync) the filesystem is not forced to flush pending writes.$

ERROR: code indent should never use tabs
#2946: FILE: tools/virtiofsd/fuse_lowlevel.h:583:
+^I * One reason to flush data is if the filesystem wants to return$

ERROR: code indent should never use tabs
#2947: FILE: tools/virtiofsd/fuse_lowlevel.h:584:
+^I * write errors during close. However, such use is non-portable$

ERROR: code indent should never use tabs
#2948: FILE: tools/virtiofsd/fuse_lowlevel.h:585:
+^I * because POSIX does not require [close] to wait for delayed I/O to$

ERROR: code indent should never use tabs
#2949: FILE: tools/virtiofsd/fuse_lowlevel.h:586:
+^I * complete.$

ERROR: code indent should never use tabs
#2950: FILE: tools/virtiofsd/fuse_lowlevel.h:587:
+^I *$

ERROR: code indent should never use tabs
#2951: FILE: tools/virtiofsd/fuse_lowlevel.h:588:
+^I * If the filesystem supports file locking operations (setlk,$

ERROR: code indent should never use tabs
#2952: FILE: tools/virtiofsd/fuse_lowlevel.h:589:
+^I * getlk) it should remove all locks belonging to 'fi->owner'.$

ERROR: code indent should never use tabs
#2953: FILE: tools/virtiofsd/fuse_lowlevel.h:590:
+^I *$

ERROR: code indent should never use tabs
#2954: FILE: tools/virtiofsd/fuse_lowlevel.h:591:
+^I * If this request is answered with an error code of ENOSYS,$

ERROR: code indent should never use tabs
#2955: FILE: tools/virtiofsd/fuse_lowlevel.h:592:
+^I * this is treated as success and future calls to flush() will$

ERROR: code indent should never use tabs
#2956: FILE: tools/virtiofsd/fuse_lowlevel.h:593:
+^I * succeed automatically without being send to the filesystem$

ERROR: code indent should never use tabs
#2957: FILE: tools/virtiofsd/fuse_lowlevel.h:594:
+^I * process.$

ERROR: code indent should never use tabs
#2958: FILE: tools/virtiofsd/fuse_lowlevel.h:595:
+^I *$

ERROR: code indent should never use tabs
#2959: FILE: tools/virtiofsd/fuse_lowlevel.h:596:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2960: FILE: tools/virtiofsd/fuse_lowlevel.h:597:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2961: FILE: tools/virtiofsd/fuse_lowlevel.h:598:
+^I *$

ERROR: code indent should never use tabs
#2962: FILE: tools/virtiofsd/fuse_lowlevel.h:599:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2963: FILE: tools/virtiofsd/fuse_lowlevel.h:600:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2964: FILE: tools/virtiofsd/fuse_lowlevel.h:601:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#2965: FILE: tools/virtiofsd/fuse_lowlevel.h:602:
+^I *$

WARNING: line over 80 characters
#2966: FILE: tools/virtiofsd/fuse_lowlevel.h:603:
+ * [close]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html

ERROR: code indent should never use tabs
#2966: FILE: tools/virtiofsd/fuse_lowlevel.h:603:
+^I * [close]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html$

ERROR: code indent should never use tabs
#2967: FILE: tools/virtiofsd/fuse_lowlevel.h:604:
+^I */$

ERROR: code indent should never use tabs #2968: FILE: tools/virtiofsd/fuse_lowlevel.h:605:
+^Ivoid (*flush) (fuse_req_t req, fuse_ino_t ino,$

ERROR: code indent should never use tabs
#2969: FILE: tools/virtiofsd/fuse_lowlevel.h:606:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2971: FILE: tools/virtiofsd/fuse_lowlevel.h:608:
+^I/**$

ERROR: code indent should never use tabs
#2972: FILE: tools/virtiofsd/fuse_lowlevel.h:609:
+^I * Release an open file$

ERROR: code indent should never use tabs
#2973: FILE: tools/virtiofsd/fuse_lowlevel.h:610:
+^I *$

ERROR: code indent should never use tabs
#2974: FILE: tools/virtiofsd/fuse_lowlevel.h:611:
+^I * Release is called when there are no more references to an open$

ERROR: code indent should never use tabs
#2975: FILE: tools/virtiofsd/fuse_lowlevel.h:612:
+^I * file: all file descriptors are closed and all memory mappings$

ERROR: code indent should never use tabs
#2976: FILE: tools/virtiofsd/fuse_lowlevel.h:613:
+^I * are unmapped.$

ERROR: code indent should never use tabs
#2977: FILE: tools/virtiofsd/fuse_lowlevel.h:614:
+^I *$

ERROR: code indent should never use tabs
#2978: FILE: tools/virtiofsd/fuse_lowlevel.h:615:
+^I * For every open call there will be exactly one release call (unless$

ERROR: code indent should never use tabs
#2979: FILE: tools/virtiofsd/fuse_lowlevel.h:616:
+^I * the filesystem is force-unmounted).$

ERROR: code indent should never use tabs
#2980: FILE: tools/virtiofsd/fuse_lowlevel.h:617:
+^I *$

ERROR: code indent should never use tabs
#2981: FILE: tools/virtiofsd/fuse_lowlevel.h:618:
+^I * The filesystem may reply with an error, but error values are$

ERROR: code indent should never use tabs
#2982: FILE: tools/virtiofsd/fuse_lowlevel.h:619:
+^I * not returned to close() or munmap() which triggered the$

ERROR: code indent should never use tabs
#2983: FILE: tools/virtiofsd/fuse_lowlevel.h:620:
+^I * release.$

ERROR: code indent should never use tabs
#2984: FILE: tools/virtiofsd/fuse_lowlevel.h:621:
+^I *$

ERROR: code indent should never use tabs
#2985: FILE: tools/virtiofsd/fuse_lowlevel.h:622:
+^I * fi->fh will contain the value set by the open method, or will$

ERROR: code indent should never use tabs
#2986: FILE: tools/virtiofsd/fuse_lowlevel.h:623:
+^I * be undefined if the open method didn't set any value.$

ERROR: code indent should never use tabs
#2987: FILE: tools/virtiofsd/fuse_lowlevel.h:624:
+^I * fi->flags will contain the same flags as for open.$

ERROR: code indent should never use tabs
#2988: FILE: tools/virtiofsd/fuse_lowlevel.h:625:
+^I *$

ERROR: code indent should never use tabs
#2989: FILE: tools/virtiofsd/fuse_lowlevel.h:626:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#2990: FILE: tools/virtiofsd/fuse_lowlevel.h:627:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#2991: FILE: tools/virtiofsd/fuse_lowlevel.h:628:
+^I *$

ERROR: code indent should never use tabs
#2992: FILE: tools/virtiofsd/fuse_lowlevel.h:629:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#2993: FILE: tools/virtiofsd/fuse_lowlevel.h:630:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#2994: FILE: tools/virtiofsd/fuse_lowlevel.h:631:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#2995: FILE: tools/virtiofsd/fuse_lowlevel.h:632:
+^I */$

ERROR: code indent should never use tabs #2996: FILE: tools/virtiofsd/fuse_lowlevel.h:633:
+^Ivoid (*release) (fuse_req_t req, fuse_ino_t ino,$

ERROR: code indent should never use tabs
#2997: FILE: tools/virtiofsd/fuse_lowlevel.h:634:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#2999: FILE: tools/virtiofsd/fuse_lowlevel.h:636:
+^I/**$

ERROR: code indent should never use tabs
#3000: FILE: tools/virtiofsd/fuse_lowlevel.h:637:
+^I * Synchronize file contents$

ERROR: code indent should never use tabs
#3001: FILE: tools/virtiofsd/fuse_lowlevel.h:638:
+^I *$

ERROR: code indent should never use tabs
#3002: FILE: tools/virtiofsd/fuse_lowlevel.h:639:
+^I * If the datasync parameter is non-zero, then only the user data$

ERROR: code indent should never use tabs
#3003: FILE: tools/virtiofsd/fuse_lowlevel.h:640:
+^I * should be flushed, not the meta data.$

ERROR: code indent should never use tabs
#3004: FILE: tools/virtiofsd/fuse_lowlevel.h:641:
+^I *$

ERROR: code indent should never use tabs
#3005: FILE: tools/virtiofsd/fuse_lowlevel.h:642:
+^I * If this request is answered with an error code of ENOSYS,$

ERROR: code indent should never use tabs
#3006: FILE: tools/virtiofsd/fuse_lowlevel.h:643:
+^I * this is treated as success and future calls to fsync() will$

ERROR: code indent should never use tabs
#3007: FILE: tools/virtiofsd/fuse_lowlevel.h:644:
+^I * succeed automatically without being send to the filesystem$

ERROR: code indent should never use tabs
#3008: FILE: tools/virtiofsd/fuse_lowlevel.h:645:
+^I * process.$

ERROR: code indent should never use tabs
#3009: FILE: tools/virtiofsd/fuse_lowlevel.h:646:
+^I *$

ERROR: code indent should never use tabs
#3010: FILE: tools/virtiofsd/fuse_lowlevel.h:647:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3011: FILE: tools/virtiofsd/fuse_lowlevel.h:648:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3012: FILE: tools/virtiofsd/fuse_lowlevel.h:649:
+^I *$

ERROR: code indent should never use tabs
#3013: FILE: tools/virtiofsd/fuse_lowlevel.h:650:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3014: FILE: tools/virtiofsd/fuse_lowlevel.h:651:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3015: FILE: tools/virtiofsd/fuse_lowlevel.h:652:
+^I * @param datasync flag indicating if only data should be flushed$

ERROR: code indent should never use tabs
#3016: FILE: tools/virtiofsd/fuse_lowlevel.h:653:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#3017: FILE: tools/virtiofsd/fuse_lowlevel.h:654:
+^I */$

ERROR: code indent should never use tabs
#3018: FILE: tools/virtiofsd/fuse_lowlevel.h:655:
+^Ivoid (*fsync) (fuse_req_t req, fuse_ino_t ino, int datasync,$

ERROR: code indent should never use tabs
#3019: FILE: tools/virtiofsd/fuse_lowlevel.h:656:
+^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#3021: FILE: tools/virtiofsd/fuse_lowlevel.h:658:
+^I/**$

ERROR: code indent should never use tabs
#3022: FILE: tools/virtiofsd/fuse_lowlevel.h:659:
+^I * Open a directory$

ERROR: code indent should never use tabs
#3023: FILE: tools/virtiofsd/fuse_lowlevel.h:660:
+^I *$

ERROR: code indent should never use tabs
#3024: FILE: tools/virtiofsd/fuse_lowlevel.h:661:
+^I * Filesystem may store an arbitrary file handle (pointer, index,$

ERROR: code indent should never use tabs
#3025: FILE: tools/virtiofsd/fuse_lowlevel.h:662:
+^I * etc) in fi->fh, and use this in other all other directory$

ERROR: code indent should never use tabs
#3026: FILE: tools/virtiofsd/fuse_lowlevel.h:663:
+^I * stream operations (readdir, releasedir, fsyncdir).$

ERROR: code indent should never use tabs
#3027: FILE: tools/virtiofsd/fuse_lowlevel.h:664:
+^I *$

ERROR: code indent should never use tabs
#3028: FILE: tools/virtiofsd/fuse_lowlevel.h:665:
+^I * If this request is answered with an error code of ENOSYS and$

ERROR: code indent should never use tabs
#3029: FILE: tools/virtiofsd/fuse_lowlevel.h:666:
+^I * FUSE_CAP_NO_OPENDIR_SUPPORT is set in fuse_conn_info.capable,$

ERROR: code indent should never use tabs
#3030: FILE: tools/virtiofsd/fuse_lowlevel.h:667:
+^I * this is treated as success and future calls to opendir and$

ERROR: code indent should never use tabs
#3031: FILE: tools/virtiofsd/fuse_lowlevel.h:668:
+^I * releasedir will also succeed without being sent to the filesystem$

ERROR: code indent should never use tabs
#3032: FILE: tools/virtiofsd/fuse_lowlevel.h:669:
+^I * process. In addition, the kernel will cache readdir results$

ERROR: code indent should never use tabs
#3033: FILE: tools/virtiofsd/fuse_lowlevel.h:670:
+^I * as if opendir returned FOPEN_KEEP_CACHE | FOPEN_CACHE_DIR.$

ERROR: code indent should never use tabs
#3034: FILE: tools/virtiofsd/fuse_lowlevel.h:671:
+^I *$

ERROR: code indent should never use tabs
#3035: FILE: tools/virtiofsd/fuse_lowlevel.h:672:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3036: FILE: tools/virtiofsd/fuse_lowlevel.h:673:
+^I * fuse_reply_open$

ERROR: code indent should never use tabs
#3037: FILE: tools/virtiofsd/fuse_lowlevel.h:674:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3038: FILE: tools/virtiofsd/fuse_lowlevel.h:675:
+^I *$

ERROR: code indent should never use tabs
#3039: FILE: tools/virtiofsd/fuse_lowlevel.h:676:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3040: FILE: tools/virtiofsd/fuse_lowlevel.h:677:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3041: FILE: tools/virtiofsd/fuse_lowlevel.h:678:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#3042: FILE: tools/virtiofsd/fuse_lowlevel.h:679:
+^I */$

ERROR: code indent should never use tabs #3043: FILE: tools/virtiofsd/fuse_lowlevel.h:680:
+^Ivoid (*opendir) (fuse_req_t req, fuse_ino_t ino,$

ERROR: code indent should never use tabs
#3044: FILE: tools/virtiofsd/fuse_lowlevel.h:681:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#3046: FILE: tools/virtiofsd/fuse_lowlevel.h:683:
+^I/**$

ERROR: code indent should never use tabs
#3047: FILE: tools/virtiofsd/fuse_lowlevel.h:684:
+^I * Read directory$

ERROR: code indent should never use tabs
#3048: FILE: tools/virtiofsd/fuse_lowlevel.h:685:
+^I *$

ERROR: code indent should never use tabs
#3049: FILE: tools/virtiofsd/fuse_lowlevel.h:686:
+^I * Send a buffer filled using fuse_add_direntry(), with size not$

ERROR: code indent should never use tabs
#3050: FILE: tools/virtiofsd/fuse_lowlevel.h:687:
+^I * exceeding the requested size. Send an empty buffer on end of$

ERROR: code indent should never use tabs
#3051: FILE: tools/virtiofsd/fuse_lowlevel.h:688:
+^I * stream.$

ERROR: code indent should never use tabs
#3052: FILE: tools/virtiofsd/fuse_lowlevel.h:689:
+^I *$

ERROR: code indent should never use tabs
#3053: FILE: tools/virtiofsd/fuse_lowlevel.h:690:
+^I * fi->fh will contain the value set by the opendir method, or$

ERROR: code indent should never use tabs
#3054: FILE: tools/virtiofsd/fuse_lowlevel.h:691:
+^I * will be undefined if the opendir method didn't set any value.$

ERROR: code indent should never use tabs
#3055: FILE: tools/virtiofsd/fuse_lowlevel.h:692:
+^I *$

ERROR: code indent should never use tabs
#3056: FILE: tools/virtiofsd/fuse_lowlevel.h:693:
+^I * Returning a directory entry from readdir() does not affect$

ERROR: code indent should never use tabs
#3057: FILE: tools/virtiofsd/fuse_lowlevel.h:694:
+^I * its lookup count.$

ERROR: code indent should never use tabs
#3058: FILE: tools/virtiofsd/fuse_lowlevel.h:695:
+^I *$

ERROR: code indent should never use tabs
#3060: FILE: tools/virtiofsd/fuse_lowlevel.h:697:
+^I * values that was previously returned by readdir() for the same$

ERROR: code indent should never use tabs
#3061: FILE: tools/virtiofsd/fuse_lowlevel.h:698:
+^I * directory handle. In this case, readdir() should skip over entries$

ERROR: code indent should never use tabs
#3062: FILE: tools/virtiofsd/fuse_lowlevel.h:699:
+^I * coming before the position defined by the off_t value. If entries$

WARNING: line over 80 characters
#3063: FILE: tools/virtiofsd/fuse_lowlevel.h:700:
+ * are added or removed while the directory handle is open, they filesystem

ERROR: code indent should never use tabs
#3063: FILE: tools/virtiofsd/fuse_lowlevel.h:700:
+^I * are added or removed while the directory handle is open, they filesystem$

ERROR: code indent should never use tabs
#3064: FILE: tools/virtiofsd/fuse_lowlevel.h:701:
+^I * may still include the entries that have been removed, and may not$

ERROR: code indent should never use tabs
#3065: FILE: tools/virtiofsd/fuse_lowlevel.h:702:
+^I * report the entries that have been created. However, addition or$

ERROR: code indent should never use tabs
#3066: FILE: tools/virtiofsd/fuse_lowlevel.h:703:
+^I * removal of entries must never cause readdir() to skip over unrelated$

ERROR: code indent should never use tabs
#3067: FILE: tools/virtiofsd/fuse_lowlevel.h:704:
+^I * entries or to report them more than once. This means$

ERROR: code indent should never use tabs
#3068: FILE: tools/virtiofsd/fuse_lowlevel.h:705:
+^I * that off_t can not be a simple index that enumerates the entries$

ERROR: code indent should never use tabs
#3069: FILE: tools/virtiofsd/fuse_lowlevel.h:706:
+^I * that have been returned but must contain sufficient information to$

ERROR: code indent should never use tabs
#3070: FILE: tools/virtiofsd/fuse_lowlevel.h:707:
+^I * uniquely determine the next directory entry to return even when the$

ERROR: code indent should never use tabs
#3071: FILE: tools/virtiofsd/fuse_lowlevel.h:708:
+^I * set of entries is changing.$

ERROR: code indent should never use tabs
#3072: FILE: tools/virtiofsd/fuse_lowlevel.h:709:
+^I *$

ERROR: code indent should never use tabs
#3073: FILE: tools/virtiofsd/fuse_lowlevel.h:710:
+^I * The function does not have to report the '.' and '..'$

ERROR: code indent should never use tabs
#3074: FILE: tools/virtiofsd/fuse_lowlevel.h:711:
+^I * entries, but is allowed to do so. Note that, if readdir does$

ERROR: code indent should never use tabs
#3075: FILE: tools/virtiofsd/fuse_lowlevel.h:712:
+^I * not return '.' or '..', they will not be implicitly returned,$

ERROR: code indent should never use tabs #3076: FILE: tools/virtiofsd/fuse_lowlevel.h:713:
+^I * and this behavior is observable by the caller.$

ERROR: code indent should never use tabs
#3077: FILE: tools/virtiofsd/fuse_lowlevel.h:714:
+^I *$

ERROR: code indent should never use tabs
#3078: FILE: tools/virtiofsd/fuse_lowlevel.h:715:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3079: FILE: tools/virtiofsd/fuse_lowlevel.h:716:
+^I * fuse_reply_buf$

ERROR: code indent should never use tabs
#3080: FILE: tools/virtiofsd/fuse_lowlevel.h:717:
+^I * fuse_reply_data$

ERROR: code indent should never use tabs
#3081: FILE: tools/virtiofsd/fuse_lowlevel.h:718:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3082: FILE: tools/virtiofsd/fuse_lowlevel.h:719:
+^I *$

ERROR: code indent should never use tabs
#3083: FILE: tools/virtiofsd/fuse_lowlevel.h:720:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3084: FILE: tools/virtiofsd/fuse_lowlevel.h:721:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs #3085: FILE: tools/virtiofsd/fuse_lowlevel.h:722:
+^I * @param size maximum number of bytes to send$

ERROR: code indent should never use tabs
#3086: FILE: tools/virtiofsd/fuse_lowlevel.h:723:
+^I * @param off offset to continue reading the directory stream$

ERROR: code indent should never use tabs
#3087: FILE: tools/virtiofsd/fuse_lowlevel.h:724:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#3088: FILE: tools/virtiofsd/fuse_lowlevel.h:725:
+^I */$

ERROR: code indent should never use tabs
#3089: FILE: tools/virtiofsd/fuse_lowlevel.h:726:
+^Ivoid (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off,$

ERROR: code indent should never use tabs
#3090: FILE: tools/virtiofsd/fuse_lowlevel.h:727:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#3092: FILE: tools/virtiofsd/fuse_lowlevel.h:729:
+^I/**$

ERROR: code indent should never use tabs
#3093: FILE: tools/virtiofsd/fuse_lowlevel.h:730:
+^I * Release an open directory$

ERROR: code indent should never use tabs
#3094: FILE: tools/virtiofsd/fuse_lowlevel.h:731:
+^I *$

ERROR: code indent should never use tabs
#3095: FILE: tools/virtiofsd/fuse_lowlevel.h:732:
+^I * For every opendir call there will be exactly one releasedir$

ERROR: code indent should never use tabs #3096: FILE: tools/virtiofsd/fuse_lowlevel.h:733:
+^I * call (unless the filesystem is force-unmounted).$

ERROR: code indent should never use tabs
#3097: FILE: tools/virtiofsd/fuse_lowlevel.h:734:
+^I *$

ERROR: code indent should never use tabs
#3098: FILE: tools/virtiofsd/fuse_lowlevel.h:735:
+^I * fi->fh will contain the value set by the opendir method, or$

ERROR: code indent should never use tabs
#3099: FILE: tools/virtiofsd/fuse_lowlevel.h:736:
+^I * will be undefined if the opendir method didn't set any value.$

ERROR: code indent should never use tabs
#3100: FILE: tools/virtiofsd/fuse_lowlevel.h:737:
+^I *$

ERROR: code indent should never use tabs
#3101: FILE: tools/virtiofsd/fuse_lowlevel.h:738:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3102: FILE: tools/virtiofsd/fuse_lowlevel.h:739:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3103: FILE: tools/virtiofsd/fuse_lowlevel.h:740:
+^I *$

ERROR: code indent should never use tabs
#3104: FILE: tools/virtiofsd/fuse_lowlevel.h:741:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3105: FILE: tools/virtiofsd/fuse_lowlevel.h:742:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3106: FILE: tools/virtiofsd/fuse_lowlevel.h:743:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#3107: FILE: tools/virtiofsd/fuse_lowlevel.h:744:
+^I */$

ERROR: code indent should never use tabs #3108: FILE: tools/virtiofsd/fuse_lowlevel.h:745:
+^Ivoid (*releasedir) (fuse_req_t req, fuse_ino_t ino,$

ERROR: code indent should never use tabs
#3109: FILE: tools/virtiofsd/fuse_lowlevel.h:746:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#3111: FILE: tools/virtiofsd/fuse_lowlevel.h:748:
+^I/**$

ERROR: code indent should never use tabs
#3112: FILE: tools/virtiofsd/fuse_lowlevel.h:749:
+^I * Synchronize directory contents$

ERROR: code indent should never use tabs
#3113: FILE: tools/virtiofsd/fuse_lowlevel.h:750:
+^I *$

ERROR: code indent should never use tabs
#3114: FILE: tools/virtiofsd/fuse_lowlevel.h:751:
+^I * If the datasync parameter is non-zero, then only the directory$

ERROR: code indent should never use tabs #3115: FILE: tools/virtiofsd/fuse_lowlevel.h:752:
+^I * contents should be flushed, not the meta data.$

ERROR: code indent should never use tabs
#3116: FILE: tools/virtiofsd/fuse_lowlevel.h:753:
+^I *$

ERROR: code indent should never use tabs
#3117: FILE: tools/virtiofsd/fuse_lowlevel.h:754:
+^I * fi->fh will contain the value set by the opendir method, or$

ERROR: code indent should never use tabs
#3118: FILE: tools/virtiofsd/fuse_lowlevel.h:755:
+^I * will be undefined if the opendir method didn't set any value.$

ERROR: code indent should never use tabs
#3119: FILE: tools/virtiofsd/fuse_lowlevel.h:756:
+^I *$

ERROR: code indent should never use tabs
#3120: FILE: tools/virtiofsd/fuse_lowlevel.h:757:
+^I * If this request is answered with an error code of ENOSYS,$

ERROR: code indent should never use tabs
#3121: FILE: tools/virtiofsd/fuse_lowlevel.h:758:
+^I * this is treated as success and future calls to fsyncdir() will$

ERROR: code indent should never use tabs
#3122: FILE: tools/virtiofsd/fuse_lowlevel.h:759:
+^I * succeed automatically without being send to the filesystem$

ERROR: code indent should never use tabs
#3123: FILE: tools/virtiofsd/fuse_lowlevel.h:760:
+^I * process.$

ERROR: code indent should never use tabs
#3124: FILE: tools/virtiofsd/fuse_lowlevel.h:761:
+^I *$

ERROR: code indent should never use tabs
#3125: FILE: tools/virtiofsd/fuse_lowlevel.h:762:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3126: FILE: tools/virtiofsd/fuse_lowlevel.h:763:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3127: FILE: tools/virtiofsd/fuse_lowlevel.h:764:
+^I *$

ERROR: code indent should never use tabs
#3128: FILE: tools/virtiofsd/fuse_lowlevel.h:765:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3129: FILE: tools/virtiofsd/fuse_lowlevel.h:766:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3130: FILE: tools/virtiofsd/fuse_lowlevel.h:767:
+^I * @param datasync flag indicating if only data should be flushed$

ERROR: code indent should never use tabs
#3131: FILE: tools/virtiofsd/fuse_lowlevel.h:768:
+^I * @param fi file information$

ERROR: code indent should never use tabs
#3132: FILE: tools/virtiofsd/fuse_lowlevel.h:769:
+^I */$

ERROR: code indent should never use tabs
#3133: FILE: tools/virtiofsd/fuse_lowlevel.h:770:
+^Ivoid (*fsyncdir) (fuse_req_t req, fuse_ino_t ino, int datasync,$

ERROR: code indent should never use tabs
#3134: FILE: tools/virtiofsd/fuse_lowlevel.h:771:
+^I^I^I struct fuse_file_info *fi);$

ERROR: code indent should never use tabs
#3136: FILE: tools/virtiofsd/fuse_lowlevel.h:773:
+^I/**$

ERROR: code indent should never use tabs
#3137: FILE: tools/virtiofsd/fuse_lowlevel.h:774:
+^I * Get file system statistics$

ERROR: code indent should never use tabs
#3138: FILE: tools/virtiofsd/fuse_lowlevel.h:775:
+^I *$

ERROR: code indent should never use tabs
#3139: FILE: tools/virtiofsd/fuse_lowlevel.h:776:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3140: FILE: tools/virtiofsd/fuse_lowlevel.h:777:
+^I * fuse_reply_statfs$

ERROR: code indent should never use tabs
#3141: FILE: tools/virtiofsd/fuse_lowlevel.h:778:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3142: FILE: tools/virtiofsd/fuse_lowlevel.h:779:
+^I *$

ERROR: code indent should never use tabs
#3143: FILE: tools/virtiofsd/fuse_lowlevel.h:780:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3144: FILE: tools/virtiofsd/fuse_lowlevel.h:781:
+^I * @param ino the inode number, zero means "undefined"$

ERROR: code indent should never use tabs
#3145: FILE: tools/virtiofsd/fuse_lowlevel.h:782:
+^I */$

ERROR: code indent should never use tabs #3146: FILE: tools/virtiofsd/fuse_lowlevel.h:783:
+^Ivoid (*statfs) (fuse_req_t req, fuse_ino_t ino);$

ERROR: code indent should never use tabs
#3148: FILE: tools/virtiofsd/fuse_lowlevel.h:785:
+^I/**$

ERROR: code indent should never use tabs
#3149: FILE: tools/virtiofsd/fuse_lowlevel.h:786:
+^I * Set an extended attribute$

ERROR: code indent should never use tabs
#3150: FILE: tools/virtiofsd/fuse_lowlevel.h:787:
+^I *$

ERROR: code indent should never use tabs
#3151: FILE: tools/virtiofsd/fuse_lowlevel.h:788:
+^I * If this request is answered with an error code of ENOSYS, this is$

ERROR: code indent should never use tabs
#3152: FILE: tools/virtiofsd/fuse_lowlevel.h:789:
+^I * treated as a permanent failure with error code EOPNOTSUPP, i.e. all$

ERROR: code indent should never use tabs
#3153: FILE: tools/virtiofsd/fuse_lowlevel.h:790:
+^I * future setxattr() requests will fail with EOPNOTSUPP without being$

ERROR: code indent should never use tabs
#3154: FILE: tools/virtiofsd/fuse_lowlevel.h:791:
+^I * send to the filesystem process.$

ERROR: code indent should never use tabs
#3155: FILE: tools/virtiofsd/fuse_lowlevel.h:792:
+^I *$

ERROR: code indent should never use tabs
#3156: FILE: tools/virtiofsd/fuse_lowlevel.h:793:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3157: FILE: tools/virtiofsd/fuse_lowlevel.h:794:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3158: FILE: tools/virtiofsd/fuse_lowlevel.h:795:
+^I */$

ERROR: code indent should never use tabs
#3159: FILE: tools/virtiofsd/fuse_lowlevel.h:796:
+^Ivoid (*setxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,$

ERROR: code indent should never use tabs #3160: FILE: tools/virtiofsd/fuse_lowlevel.h:797:
+^I^I^I const char *value, size_t size, int flags);$

ERROR: code indent should never use tabs
#3162: FILE: tools/virtiofsd/fuse_lowlevel.h:799:
+^I/**$

ERROR: code indent should never use tabs
#3163: FILE: tools/virtiofsd/fuse_lowlevel.h:800:
+^I * Get an extended attribute$

ERROR: code indent should never use tabs
#3164: FILE: tools/virtiofsd/fuse_lowlevel.h:801:
+^I *$

ERROR: code indent should never use tabs
#3165: FILE: tools/virtiofsd/fuse_lowlevel.h:802:
+^I * If size is zero, the size of the value should be sent with$

ERROR: code indent should never use tabs
#3166: FILE: tools/virtiofsd/fuse_lowlevel.h:803:
+^I * fuse_reply_xattr.$

ERROR: code indent should never use tabs
#3167: FILE: tools/virtiofsd/fuse_lowlevel.h:804:
+^I *$

ERROR: code indent should never use tabs
#3168: FILE: tools/virtiofsd/fuse_lowlevel.h:805:
+^I * If the size is non-zero, and the value fits in the buffer, the$

ERROR: code indent should never use tabs
#3169: FILE: tools/virtiofsd/fuse_lowlevel.h:806:
+^I * value should be sent with fuse_reply_buf.$

ERROR: code indent should never use tabs
#3170: FILE: tools/virtiofsd/fuse_lowlevel.h:807:
+^I *$

ERROR: code indent should never use tabs
#3171: FILE: tools/virtiofsd/fuse_lowlevel.h:808:
+^I * If the size is too small for the value, the ERANGE error should$

ERROR: code indent should never use tabs
#3172: FILE: tools/virtiofsd/fuse_lowlevel.h:809:
+^I * be sent.$

ERROR: code indent should never use tabs
#3173: FILE: tools/virtiofsd/fuse_lowlevel.h:810:
+^I *$

ERROR: code indent should never use tabs
#3174: FILE: tools/virtiofsd/fuse_lowlevel.h:811:
+^I * If this request is answered with an error code of ENOSYS, this is$

ERROR: code indent should never use tabs
#3175: FILE: tools/virtiofsd/fuse_lowlevel.h:812:
+^I * treated as a permanent failure with error code EOPNOTSUPP, i.e. all$

ERROR: code indent should never use tabs
#3176: FILE: tools/virtiofsd/fuse_lowlevel.h:813:
+^I * future getxattr() requests will fail with EOPNOTSUPP without being$

ERROR: code indent should never use tabs
#3177: FILE: tools/virtiofsd/fuse_lowlevel.h:814:
+^I * send to the filesystem process.$

ERROR: code indent should never use tabs
#3178: FILE: tools/virtiofsd/fuse_lowlevel.h:815:
+^I *$

ERROR: code indent should never use tabs
#3179: FILE: tools/virtiofsd/fuse_lowlevel.h:816:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3180: FILE: tools/virtiofsd/fuse_lowlevel.h:817:
+^I * fuse_reply_buf$

ERROR: code indent should never use tabs
#3181: FILE: tools/virtiofsd/fuse_lowlevel.h:818:
+^I * fuse_reply_data$

ERROR: code indent should never use tabs
#3182: FILE: tools/virtiofsd/fuse_lowlevel.h:819:
+^I * fuse_reply_xattr$

ERROR: code indent should never use tabs
#3183: FILE: tools/virtiofsd/fuse_lowlevel.h:820:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3184: FILE: tools/virtiofsd/fuse_lowlevel.h:821:
+^I *$

ERROR: code indent should never use tabs
#3185: FILE: tools/virtiofsd/fuse_lowlevel.h:822:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3186: FILE: tools/virtiofsd/fuse_lowlevel.h:823:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3187: FILE: tools/virtiofsd/fuse_lowlevel.h:824:
+^I * @param name of the extended attribute$

ERROR: code indent should never use tabs #3188: FILE: tools/virtiofsd/fuse_lowlevel.h:825:
+^I * @param size maximum size of the value to send$

ERROR: code indent should never use tabs
#3189: FILE: tools/virtiofsd/fuse_lowlevel.h:826:
+^I */$

ERROR: code indent should never use tabs
#3190: FILE: tools/virtiofsd/fuse_lowlevel.h:827:
+^Ivoid (*getxattr) (fuse_req_t req, fuse_ino_t ino, const char *name,$

ERROR: code indent should never use tabs
#3191: FILE: tools/virtiofsd/fuse_lowlevel.h:828:
+^I^I^I size_t size);$

ERROR: code indent should never use tabs
#3193: FILE: tools/virtiofsd/fuse_lowlevel.h:830:
+^I/**$

ERROR: code indent should never use tabs
#3194: FILE: tools/virtiofsd/fuse_lowlevel.h:831:
+^I * List extended attribute names$

ERROR: code indent should never use tabs
#3195: FILE: tools/virtiofsd/fuse_lowlevel.h:832:
+^I *$

ERROR: code indent should never use tabs
#3196: FILE: tools/virtiofsd/fuse_lowlevel.h:833:
+^I * If size is zero, the total size of the attribute list should be$

ERROR: code indent should never use tabs
#3197: FILE: tools/virtiofsd/fuse_lowlevel.h:834:
+^I * sent with fuse_reply_xattr.$

ERROR: code indent should never use tabs
#3198: FILE: tools/virtiofsd/fuse_lowlevel.h:835:
+^I *$

ERROR: code indent should never use tabs
#3199: FILE: tools/virtiofsd/fuse_lowlevel.h:836:
+^I * If the size is non-zero, and the null character separated$

ERROR: code indent should never use tabs
#3200: FILE: tools/virtiofsd/fuse_lowlevel.h:837:
+^I * attribute list fits in the buffer, the list should be sent with$

ERROR: code indent should never use tabs
#3201: FILE: tools/virtiofsd/fuse_lowlevel.h:838:
+^I * fuse_reply_buf.$

ERROR: code indent should never use tabs
#3202: FILE: tools/virtiofsd/fuse_lowlevel.h:839:
+^I *$

ERROR: code indent should never use tabs
#3203: FILE: tools/virtiofsd/fuse_lowlevel.h:840:
+^I * If the size is too small for the list, the ERANGE error should$

ERROR: code indent should never use tabs
#3204: FILE: tools/virtiofsd/fuse_lowlevel.h:841:
+^I * be sent.$

ERROR: code indent should never use tabs
#3205: FILE: tools/virtiofsd/fuse_lowlevel.h:842:
+^I *$

ERROR: code indent should never use tabs
#3206: FILE: tools/virtiofsd/fuse_lowlevel.h:843:
+^I * If this request is answered with an error code of ENOSYS, this is$

ERROR: code indent should never use tabs
#3207: FILE: tools/virtiofsd/fuse_lowlevel.h:844:
+^I * treated as a permanent failure with error code EOPNOTSUPP, i.e. all$

ERROR: code indent should never use tabs
#3208: FILE: tools/virtiofsd/fuse_lowlevel.h:845:
+^I * future listxattr() requests will fail with EOPNOTSUPP without being$

ERROR: code indent should never use tabs
#3209: FILE: tools/virtiofsd/fuse_lowlevel.h:846:
+^I * send to the filesystem process.$

ERROR: code indent should never use tabs
#3210: FILE: tools/virtiofsd/fuse_lowlevel.h:847:
+^I *$

ERROR: code indent should never use tabs
#3211: FILE: tools/virtiofsd/fuse_lowlevel.h:848:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3212: FILE: tools/virtiofsd/fuse_lowlevel.h:849:
+^I * fuse_reply_buf$

ERROR: code indent should never use tabs
#3213: FILE: tools/virtiofsd/fuse_lowlevel.h:850:
+^I * fuse_reply_data$

ERROR: code indent should never use tabs
#3214: FILE: tools/virtiofsd/fuse_lowlevel.h:851:
+^I * fuse_reply_xattr$

ERROR: code indent should never use tabs
#3215: FILE: tools/virtiofsd/fuse_lowlevel.h:852:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3216: FILE: tools/virtiofsd/fuse_lowlevel.h:853:
+^I *$

ERROR: code indent should never use tabs
#3217: FILE: tools/virtiofsd/fuse_lowlevel.h:854:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3218: FILE: tools/virtiofsd/fuse_lowlevel.h:855:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs #3219: FILE: tools/virtiofsd/fuse_lowlevel.h:856:
+^I * @param size maximum size of the list to send$

ERROR: code indent should never use tabs
#3220: FILE: tools/virtiofsd/fuse_lowlevel.h:857:
+^I */$

ERROR: code indent should never use tabs
#3221: FILE: tools/virtiofsd/fuse_lowlevel.h:858:
+^Ivoid (*listxattr) (fuse_req_t req, fuse_ino_t ino, size_t size);$

ERROR: code indent should never use tabs
#3223: FILE: tools/virtiofsd/fuse_lowlevel.h:860:
+^I/**$

ERROR: code indent should never use tabs
#3224: FILE: tools/virtiofsd/fuse_lowlevel.h:861:
+^I * Remove an extended attribute$

ERROR: code indent should never use tabs
#3225: FILE: tools/virtiofsd/fuse_lowlevel.h:862:
+^I *$

ERROR: code indent should never use tabs
#3226: FILE: tools/virtiofsd/fuse_lowlevel.h:863:
+^I * If this request is answered with an error code of ENOSYS, this is$

ERROR: code indent should never use tabs
#3227: FILE: tools/virtiofsd/fuse_lowlevel.h:864:
+^I * treated as a permanent failure with error code EOPNOTSUPP, i.e. all$

ERROR: code indent should never use tabs
#3228: FILE: tools/virtiofsd/fuse_lowlevel.h:865:
+^I * future removexattr() requests will fail with EOPNOTSUPP without being$

ERROR: code indent should never use tabs
#3229: FILE: tools/virtiofsd/fuse_lowlevel.h:866:
+^I * send to the filesystem process.$

ERROR: code indent should never use tabs
#3230: FILE: tools/virtiofsd/fuse_lowlevel.h:867:
+^I *$

ERROR: code indent should never use tabs
#3231: FILE: tools/virtiofsd/fuse_lowlevel.h:868:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3232: FILE: tools/virtiofsd/fuse_lowlevel.h:869:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3233: FILE: tools/virtiofsd/fuse_lowlevel.h:870:
+^I *$

ERROR: code indent should never use tabs
#3234: FILE: tools/virtiofsd/fuse_lowlevel.h:871:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3235: FILE: tools/virtiofsd/fuse_lowlevel.h:872:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3236: FILE: tools/virtiofsd/fuse_lowlevel.h:873:
+^I * @param name of the extended attribute$

ERROR: code indent should never use tabs
#3237: FILE: tools/virtiofsd/fuse_lowlevel.h:874:
+^I */$

ERROR: code indent should never use tabs
#3238: FILE: tools/virtiofsd/fuse_lowlevel.h:875:
+^Ivoid (*removexattr) (fuse_req_t req, fuse_ino_t ino, const char *name);$

ERROR: code indent should never use tabs
#3240: FILE: tools/virtiofsd/fuse_lowlevel.h:877:
+^I/**$

ERROR: code indent should never use tabs
#3241: FILE: tools/virtiofsd/fuse_lowlevel.h:878:
+^I * Check file access permissions$

ERROR: code indent should never use tabs
#3242: FILE: tools/virtiofsd/fuse_lowlevel.h:879:
+^I *$

ERROR: code indent should never use tabs
#3243: FILE: tools/virtiofsd/fuse_lowlevel.h:880:
+^I * This will be called for the access() and chdir() system$

ERROR: code indent should never use tabs
#3244: FILE: tools/virtiofsd/fuse_lowlevel.h:881:
+^I * calls. If the 'default_permissions' mount option is given,$

ERROR: code indent should never use tabs
#3245: FILE: tools/virtiofsd/fuse_lowlevel.h:882:
+^I * this method is not called.$

ERROR: code indent should never use tabs
#3246: FILE: tools/virtiofsd/fuse_lowlevel.h:883:
+^I *$

ERROR: code indent should never use tabs
#3247: FILE: tools/virtiofsd/fuse_lowlevel.h:884:
+^I * This method is not called under Linux kernel versions 2.4.x$

ERROR: code indent should never use tabs
#3248: FILE: tools/virtiofsd/fuse_lowlevel.h:885:
+^I *$

ERROR: code indent should never use tabs
#3249: FILE: tools/virtiofsd/fuse_lowlevel.h:886:
+^I * If this request is answered with an error code of ENOSYS, this is$

ERROR: code indent should never use tabs
#3250: FILE: tools/virtiofsd/fuse_lowlevel.h:887:
+^I * treated as a permanent success, i.e. this and all future access()$

ERROR: code indent should never use tabs
#3251: FILE: tools/virtiofsd/fuse_lowlevel.h:888:
+^I * requests will succeed without being send to the filesystem process.$

ERROR: code indent should never use tabs
#3252: FILE: tools/virtiofsd/fuse_lowlevel.h:889:
+^I *$

ERROR: code indent should never use tabs
#3253: FILE: tools/virtiofsd/fuse_lowlevel.h:890:
+^I * Valid replies:$

ERROR: code indent should never use tabs
#3254: FILE: tools/virtiofsd/fuse_lowlevel.h:891:
+^I * fuse_reply_err$

ERROR: code indent should never use tabs
#3255: FILE: tools/virtiofsd/fuse_lowlevel.h:892:
+^I *$

ERROR: code indent should never use tabs
#3256: FILE: tools/virtiofsd/fuse_lowlevel.h:893:
+^I * @param req request handle$

ERROR: code indent should never use tabs
#3257: FILE: tools/virtiofsd/fuse_lowlevel.h:894:
+^I * @param ino the inode number$

ERROR: code indent should never use tabs
#3258: FILE: tools/virtiofsd/fuse_lowlevel.h:895:
+^I * @param mask requested access mode$

ERROR: code indent should never use tabs
#3259: FILE: tools/virtiofsd/fuse_lowlevel.h:896:
+^I */$

ERROR: code indent should never use tabs
#3260: FILE: tools/virtiofsd/fuse_lowlevel.h:897:
+^Ivoid (*access) (fuse_req_t req, fuse_ino_t ino, int mask);$

ERROR: code indent should never use tabs
#3262: FILE: tools/virtiofsd/fuse_lowlevel.h:899:
+^I/**$

15,227 lines not shown · raw message

Part of this message is not shown here. View the raw message.