mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 01:38:57 +00:00
Return EBADF in case some vnode field has been reset to a NULL pointer.
(There has been some discussion, whether ENOENT or EBADF is more appropriate. I choose the latter, since the operation is not supported on the file descriptor at that time, even if it was, immediately before.) PR: 32681 Reviewed by: dillon, iedowse, ... Approved by: nectar MFC after: 3 days (pending RE approval)
This commit is contained in:
parent
7af51791e5
commit
10cc6dff87
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=88844
@ -795,6 +795,8 @@ fstatfs(td, uap)
|
||||
if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0)
|
||||
return (error);
|
||||
mp = ((struct vnode *)fp->f_data)->v_mount;
|
||||
if (mp == NULL)
|
||||
return (EBADF);
|
||||
sp = &mp->mnt_stat;
|
||||
error = VFS_STATFS(mp, sp, td);
|
||||
if (error)
|
||||
|
@ -795,6 +795,8 @@ fstatfs(td, uap)
|
||||
if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0)
|
||||
return (error);
|
||||
mp = ((struct vnode *)fp->f_data)->v_mount;
|
||||
if (mp == NULL)
|
||||
return (EBADF);
|
||||
sp = &mp->mnt_stat;
|
||||
error = VFS_STATFS(mp, sp, td);
|
||||
if (error)
|
||||
|
Loading…
Reference in New Issue
Block a user