diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | lib/fuse.c | 14 |
2 files changed, 12 insertions, 5 deletions
@@ -31,6 +31,9 @@ * Add ctx->pid to debug output + * Fix st_nlink value in high level lib if file is unlinked but + still open + 2010-10-14 Miklos Szeredi <miklos@szeredi.hu> * Use LTLIBICONV when linking libfuse. This fixes building against @@ -2075,11 +2075,15 @@ static void fuse_lib_getattr(fuse_req_t req, fuse_ino_t ino, free_path(f, ino, path); } if (!err) { - if (f->conf.auto_cache) { - pthread_mutex_lock(&f->lock); - update_stat(get_node(f, ino), &buf); - pthread_mutex_unlock(&f->lock); - } + struct node *node; + + pthread_mutex_lock(&f->lock); + node = get_node(f, ino); + if (node->is_hidden && buf.st_nlink > 0) + buf.st_nlink--; + if (f->conf.auto_cache) + update_stat(node, &buf); + pthread_mutex_unlock(&f->lock); set_stat(f, ino, &buf); fuse_reply_attr(req, &buf, f->conf.attr_timeout); } else |