summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/sync-interval.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libdiskfs/sync-interval.c b/libdiskfs/sync-interval.c
index c2b578a8..acdb0842 100644
--- a/libdiskfs/sync-interval.c
+++ b/libdiskfs/sync-interval.c
@@ -109,10 +109,13 @@ periodic_sync (int interval)
if (! err)
{
- rwlock_reader_lock (&diskfs_fsys_lock);
- diskfs_sync_everything (0);
- diskfs_set_hypermetadata (0, 0);
- rwlock_reader_unlock (&diskfs_fsys_lock);
+ if (! diskfs_readonly)
+ {
+ rwlock_reader_lock (&diskfs_fsys_lock);
+ diskfs_sync_everything (0);
+ diskfs_set_hypermetadata (0, 0);
+ rwlock_reader_unlock (&diskfs_fsys_lock);
+ }
ports_end_rpc (pi, &link);
}