Do not call VOP_GETATTR in getdents function. It does not serve any
purpose and the resulting vattr structure was ignored. In addition, the VOP_GETATTR call was made with no vnode lock held, resulting in vnode locking violation panic with debug kernels. Reported by: truckman Approved by: re@ (rwatson)
This commit is contained in:
parent
f6a1906569
commit
501f5ff123
@ -255,7 +255,6 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
|
||||
struct file *fp;
|
||||
struct uio auio;
|
||||
struct iovec aiov;
|
||||
struct vattr va;
|
||||
off_t off;
|
||||
struct l_dirent linux_dirent;
|
||||
struct l_dirent64 linux_dirent64;
|
||||
@ -277,11 +276,6 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
if ((error = VOP_GETATTR(vp, &va, td->td_ucred, td))) {
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
}
|
||||
|
||||
nbytes = args->count;
|
||||
if (nbytes == 1) {
|
||||
/* readdir(2) case. Always struct dirent. */
|
||||
|
@ -254,7 +254,6 @@ svr4_sys_getdents64(td, uap)
|
||||
struct file *fp;
|
||||
struct uio auio;
|
||||
struct iovec aiov;
|
||||
struct vattr va;
|
||||
off_t off;
|
||||
struct svr4_dirent64 svr4_dirent;
|
||||
int buflen, error, eofflag, nbytes, justone;
|
||||
@ -279,11 +278,6 @@ svr4_sys_getdents64(td, uap)
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
if ((error = VOP_GETATTR(vp, &va, td->td_ucred, td))) {
|
||||
fdrop(fp, td);
|
||||
return error;
|
||||
}
|
||||
|
||||
nbytes = uap->nbytes;
|
||||
if (nbytes == 1) {
|
||||
nbytes = sizeof (struct svr4_dirent64);
|
||||
|
Loading…
Reference in New Issue
Block a user