diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2010-11-08 19:43:41 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2010-11-08 19:43:41 +0100 |
commit | 86cbeb4203997bb8e3aa937f6f8a753eb5420e11 (patch) | |
tree | 003513ea5d703e265918e700acc19369d77b081a /lib | |
parent | 06f6f0b313ef389bf2271fa2950a4460227b96a7 (diff) |
Fix st_nlink for unlinked but still open files
Fix st_nlink value in high level lib if file is unlinked but still open
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuse.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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 |