Fix errno return values to better represent failure reasons for
read and open. Approved by: schweikh (mentor) Agreed: bde MFC after: 6 weeks
This commit is contained in:
parent
a3d52360e2
commit
5a5f2134b8
@ -438,7 +438,7 @@ nfs_open(struct vop_open_args *ap)
|
||||
#ifdef DIAGNOSTIC
|
||||
printf("open eacces vtyp=%d\n", vp->v_type);
|
||||
#endif
|
||||
return (EACCES);
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
/*
|
||||
* Get a valid lease. If cached data is stale, flush it.
|
||||
@ -956,9 +956,14 @@ nfs_read(struct vop_read_args *ap)
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
if (vp->v_type != VREG)
|
||||
return (EPERM);
|
||||
return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred));
|
||||
switch (vp->v_type) {
|
||||
case VREG:
|
||||
return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred));
|
||||
case VDIR:
|
||||
return EISDIR;
|
||||
default:
|
||||
return EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user