vfs: properly sync filesystem metadata on O_SYNC

This commit is contained in:
Matheus
2026-08-20 23:35:11 -03:00
parent 27c8881679
commit 70f2f05288
+3 -3
View File
@@ -538,9 +538,6 @@ int vfs_write_iovec(vnode_t *node, iovec_iterator_t *iovec_iterator, size_t size
mm_release_page(FROM_HHDM(address));
}
if (flags & V_FFLAG_MUST_SYNC)
err = mm_cache_sync_vnode(node);
} else {
// Non-cacheable objects and direct I/O bypass the page cache.
VOP_LOCK(node);
@@ -548,6 +545,9 @@ int vfs_write_iovec(vnode_t *node, iovec_iterator_t *iovec_iterator, size_t size
VOP_UNLOCK(node);
}
if (err == 0 && cacheable && (flags & V_FFLAG_MUST_SYNC))
err = VOP_SYNC(node);
leave:
if (cacheable)
MUTEX_RELEASE(&node->size_lock);