mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
vfs: properly sync filesystem metadata on O_SYNC
This commit is contained in:
+3
-3
@@ -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));
|
mm_release_page(FROM_HHDM(address));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & V_FFLAG_MUST_SYNC)
|
|
||||||
err = mm_cache_sync_vnode(node);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Non-cacheable objects and direct I/O bypass the page cache.
|
// Non-cacheable objects and direct I/O bypass the page cache.
|
||||||
VOP_LOCK(node);
|
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);
|
VOP_UNLOCK(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (err == 0 && cacheable && (flags & V_FFLAG_MUST_SYNC))
|
||||||
|
err = VOP_SYNC(node);
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
if (cacheable)
|
if (cacheable)
|
||||||
MUTEX_RELEASE(&node->size_lock);
|
MUTEX_RELEASE(&node->size_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user