git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite the lunabuild toolchain with enhanced feature (#60)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
fs
/
mount.c
diff --git
a/lunaix-os/kernel/fs/mount.c
b/lunaix-os/kernel/fs/mount.c
index 282ae784ec2bdaa4a1ee12b0a32a7497dbb884b6..1dee55a1d946626b6bf95e903153fc48b7d54d46 100644
(file)
--- 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++) {
// 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;
}
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 ((dnode->mnt->flags & MNT_RO)) {
return EROFS;
}
+
+ if (!check_allow_write(dnode->inode)) {
+ return EPERM;
+ }
+
return 0;
}
return 0;
}