From: Nikolaus Rath Date: Mon, 10 Oct 2016 03:38:24 +0000 (-0700) Subject: Don't confuse lookup count for mountpoint and file X-Git-Tag: fuse-3.0.0rc1~70 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7e562d59d4a64a14ff070bfd649de828534532e8;p=qemu-gpiodev%2Flibfuse.git Don't confuse lookup count for mountpoint and file I think this is the reason for a sporadic test failure, where fuse_lowlevel_notify_store() fails. --- diff --git a/example/notify_inval_entry.c b/example/notify_inval_entry.c index fc8bc1e..6b1b527 100644 --- a/example/notify_inval_entry.c +++ b/example/notify_inval_entry.c @@ -168,12 +168,13 @@ err_out: static void tfs_forget (fuse_req_t req, fuse_ino_t ino, uint64_t nlookup) { (void) req; - assert(ino == file_ino || ino == FUSE_ROOT_ID); - lookup_cnt -= nlookup; + if(ino == file_ino) + lookup_cnt -= nlookup; + else + assert(ino == FUSE_ROOT_ID); fuse_reply_none(req); } - static void tfs_getattr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { struct stat stbuf; diff --git a/example/notify_inval_inode.c b/example/notify_inval_inode.c index 5dfc225..4cd5be9 100644 --- a/example/notify_inval_inode.c +++ b/example/notify_inval_inode.c @@ -161,8 +161,10 @@ err_out: static void tfs_forget (fuse_req_t req, fuse_ino_t ino, uint64_t nlookup) { (void) req; - assert(ino == FILE_INO || ino == FUSE_ROOT_ID); - lookup_cnt -= nlookup; + if(ino == FILE_INO) + lookup_cnt -= nlookup; + else + assert(ino == FUSE_ROOT_ID); fuse_reply_none(req); } diff --git a/example/notify_store_retrieve.c b/example/notify_store_retrieve.c index a21d117..dc87619 100644 --- a/example/notify_store_retrieve.c +++ b/example/notify_store_retrieve.c @@ -164,8 +164,10 @@ err_out: static void tfs_forget (fuse_req_t req, fuse_ino_t ino, uint64_t nlookup) { (void) req; - assert(ino == FILE_INO || ino == FUSE_ROOT_ID); - lookup_cnt -= nlookup; + if(ino == FILE_INO) + lookup_cnt -= nlookup; + else + assert(ino == FUSE_ROOT_ID); fuse_reply_none(req); }