]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
overlayfs: improve wrapper lifetime management with root refcount
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 02:14:05 +0000 (23:14 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 02:14:05 +0000 (23:14 -0300)
commit00d2e7db1f1fbef41e34c67d22373a3963f7005c
tree8e8d17f5e0f7ada5dda92a82e35b90b02fc3c1c7
parentdd0297e956d1296469878098cef0a6af4ac02de1
overlayfs: improve wrapper lifetime management with root refcount

Implement M6: overlayfs wrapper lifetime improvements.

Added is_root flag to overlay_node to distinguish root from wrapper nodes.
Modified overlay_root_close() to properly manage root node refcount and
free overlayfs structure when root is finally closed.
Initialized root node refcount to 1 and set is_root flag in overlayfs_create_root().

This ensures proper cleanup of overlayfs structures when the filesystem
is unmounted, preventing memory leaks of the overlayfs structure and root node.

Test: make test-battery PASS (157/157), make analyzer PASS
src/kernel/overlayfs.c