Don't unhash name in FORGET

This resulted in ENOENT being returned for unlinked but still open files if the
kernel sent a FORGET request for the parent directory.

Discovered with fs_racer in LTP.
This commit is contained in:
Miklos Szeredi
2011-12-09 16:07:55 +01:00
parent bfc49cefc4
commit 4dc7e675bb
2 changed files with 5 additions and 2 deletions
+4
View File
@@ -2,6 +2,10 @@
* Fix hang in wait_on_path(). Reported by Ville Silventoinen
* Don't unhash name in FORGET. This resulted in ENOENT being
returned for unlinked but still open files if the kernel sent a
FORGET request for the parent directory.
2011-12-08 Miklos Szeredi <miklos@szeredi.hu>
* Fix build if FUSE_NODE_SLAB is not defined. Patch by Emmanuel
+1 -2
View File
@@ -775,7 +775,7 @@ static void delete_node(struct fuse *f, struct node *node)
(unsigned long long) node->nodeid);
assert(node->treelock == 0);
assert(!node->name);
unhash_name(f, node);
if (lru_enabled(f))
remove_node_lru(node);
unhash_id(f, node);
@@ -1258,7 +1258,6 @@ static void forget_node(struct fuse *f, fuse_ino_t nodeid, uint64_t nlookup)
assert(node->nlookup >= nlookup);
node->nlookup -= nlookup;
if (!node->nlookup) {
unhash_name(f, node);
unref_node(f, node);
} else if (lru_enabled(f) && node->nlookup == 1) {
set_forget_time(f, node);