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:
Stefan Eßer 2002-01-03 09:54:24 +00:00
parent 7af51791e5
commit 10cc6dff87
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=88844
2 changed files with 4 additions and 0 deletions

View File

@ -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)

View File

@ -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)