From 7e07503bbc4d85a238c8167b7a2dd536642964b8 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 11 Aug 2021 20:37:19 +0200 Subject: 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. --- libdiskfs/node-cache.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libdiskfs/node-cache.c') 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); -- cgit v1.2.3