mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
statvfs: handle vnodes without a vfs
This commit is contained in:
@@ -36,6 +36,11 @@ syscallret_t syscall_fstatvfs(context_t *ctx, int fd, statvfs_t *ustatvfs) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (file->vnode->vfs == NULL) {
|
||||
ret.errno = ENODEV;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
fsattr_t buf;
|
||||
ret.errno = VFS_STATFS(file->vnode->vfs, &buf);
|
||||
if (ret.errno)
|
||||
@@ -98,6 +103,11 @@ syscallret_t syscall_fstatvfsat(context_t *ctx, int dirfd, char *upath, stat_t *
|
||||
// locked by vfs_lookup
|
||||
VOP_UNLOCK(node);
|
||||
|
||||
if (node->vfs == NULL) {
|
||||
ret.errno = ENODEV;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
fsattr_t buf;
|
||||
ret.errno = VFS_STATFS(node->vfs, &buf);
|
||||
if (ret.errno)
|
||||
|
||||
Reference in New Issue
Block a user