Don't call forget_node() if the lookup was negative and write()
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 27 May 2009 10:17:24 +0000 (10:17 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 27 May 2009 10:17:24 +0000 (10:17 +0000)
for the reply returned ENOENT.  Reported by John Haxby

ChangeLog
lib/fuse.c

index b976a70474893be30e62f82a5a69b6091e5e6ac2..9791a7f6ae9bc267010bfd98b8a6a13b75e9079c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-27  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Don't call forget_node() if the lookup was negative and write()
+       for the reply returned ENOENT.  Reported by John Haxby
+
 2009-05-25  Miklos Szeredi <miklos@szeredi.hu>
 
        * Add FUSE_CAP_EXPORT_SUPPORT to fuse_common.h
index 3f811ae3965659acd68c5e2e325745a5e46874ac..8c27cd36beb338ecbb6c1ff76dc6f765717a5bcc 100644 (file)
@@ -1908,8 +1908,11 @@ static void reply_entry(fuse_req_t req, const struct fuse_entry_param *e,
 {
        if (!err) {
                struct fuse *f = req_fuse(req);
-               if (fuse_reply_entry(req, e) == -ENOENT)
-                       forget_node(f, e->ino, 1);
+               if (fuse_reply_entry(req, e) == -ENOENT) {
+                       /* Skip forget for negative result */
+                       if  (e->ino != 0)
+                               forget_node(f, e->ino, 1);
+               }
        } else
                reply_err(req, err);
 }