vfs_read: check for type on buffer size check
Now processes properly block
This commit is contained in:
parent
eee7d9ed4e
commit
6fdccef0ea
1 changed files with 1 additions and 1 deletions
2
fs/vfs.c
2
fs/vfs.c
|
|
@ -195,7 +195,7 @@ ssize_t vfs_read(struct file *file, void *buf, off_t off, size_t count)
|
||||||
if ((file->vnode->flags & VFS_VTYPE_MASK) == VFS_VNO_DIR)
|
if ((file->vnode->flags & VFS_VTYPE_MASK) == VFS_VNO_DIR)
|
||||||
return -EISDIR;
|
return -EISDIR;
|
||||||
|
|
||||||
if (off >= file->vnode->size)
|
if (off >= file->vnode->size && file->type == VFS_VNO_REG)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (off + count > file->vnode->size)
|
if (off + count > file->vnode->size)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue