diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1c911123930c..af581f0f5125 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2275,9 +2275,13 @@ vn_seek(struct file *fp, off_t offset, int whence, struct thread *td) break; case SEEK_DATA: error = fo_ioctl(fp, FIOSEEKDATA, &offset, cred, td); + if (error == ENOTTY) + error = EINVAL; break; case SEEK_HOLE: error = fo_ioctl(fp, FIOSEEKHOLE, &offset, cred, td); + if (error == ENOTTY) + error = EINVAL; break; default: error = EINVAL;