summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-11 20:37:19 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-11 20:38:52 +0200
commit7e07503bbc4d85a238c8167b7a2dd536642964b8 (patch)
treef5f2ad76de1e9188f7ebf77ae65c6762b9be90c5
parenta441cb616db547d366a796d0370d5f351b73b289 (diff)
libdiskfs: Flush node to disk before removing it from the cache
libdiskfs' dosync goes through the cache to flush nodes to the disk. We thus have to flush a node to the disk before removing it from the cache in diskfs_try_dropping_softrefs.
-rw-r--r--libdiskfs/node-cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdiskfs/node-cache.c b/libdiskfs/node-cache.c
index d2815883..1ff19ade 100644
--- a/libdiskfs/node-cache.c
+++ b/libdiskfs/node-cache.c
@@ -163,6 +163,10 @@ diskfs_try_dropping_softrefs (struct node *np)
hurd_ihash_locp_remove (&nodecache, np->slot);
np->slot = NULL;
+
+ /* Flush node if needed, before forgetting it */
+ diskfs_node_update (np, diskfs_synchronous);
+
diskfs_nrele_light (np);
}
pthread_rwlock_unlock (&nodecache_lock);