X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/871af48a7d8d1a8cca7b27e0e15d1dfa030bd172..c043fa535514a76091be87a45ad472a505f9dd33:/lunaix-os/kernel/fs/mount.c?ds=sidebyside diff --git a/lunaix-os/kernel/fs/mount.c b/lunaix-os/kernel/fs/mount.c index 282ae78..1dee55a 100644 --- a/lunaix-os/kernel/fs/mount.c +++ b/lunaix-os/kernel/fs/mount.c @@ -86,8 +86,8 @@ __vfs_do_unmount(struct v_mount* mnt) // detached the inodes from cache, and let lru policy to recycle them for (size_t i = 0; i < VFS_HASHTABLE_SIZE; i++) { - __detach_node_cache_ref(&sb->i_cache[i]); - __detach_node_cache_ref(&sb->d_cache[i]); + __detach_node_cache_ref(&sb->i_cache.pool[i]); + __detach_node_cache_ref(&sb->d_cache.pool[i]); } struct v_dnode *pos, *next; @@ -293,6 +293,11 @@ vfs_check_writable(struct v_dnode* dnode) if ((dnode->mnt->flags & MNT_RO)) { return EROFS; } + + if (!check_allow_write(dnode->inode)) { + return EPERM; + } + return 0; }