summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/fsys-syncfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libdiskfs/fsys-syncfs.c b/libdiskfs/fsys-syncfs.c
index 6ea8c774..81477113 100644
--- a/libdiskfs/fsys-syncfs.c
+++ b/libdiskfs/fsys-syncfs.c
@@ -52,6 +52,8 @@ diskfs_S_fsys_syncfs (fsys_t controlport,
if (!pi)
return EOPNOTSUPP;
+ rwlock_reader_lock (&diskfs_fsys_lock);
+
if (children)
diskfs_node_iterate (helper);
@@ -60,7 +62,11 @@ diskfs_S_fsys_syncfs (fsys_t controlport,
diskfs_sync_everything (wait);
diskfs_set_hypermetadata (wait, 0);
+
+ rwlock_reader_unlock (&diskfs_fsys_lock);
+
ports_port_deref (pi);
+
return 0;
}