diff options
author | ache <ache@FreeBSD.org> | 2004-01-23 06:00:41 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2004-01-23 06:00:41 +0000 |
commit | 359cfdfd9985c26e22c0aed7c2b88a482d9784ca (patch) | |
tree | b98edac28d0bbaf8b06dd69faae0cdec00c707e3 | |
parent | 1d8ca3745276bf6953613529b2cb886a36d71d68 (diff) | |
download | FreeBSD-src-359cfdfd9985c26e22c0aed7c2b88a482d9784ca.zip FreeBSD-src-359cfdfd9985c26e22c0aed7c2b88a482d9784ca.tar.gz |
Copy comment about caller check from ffs_read to ffs_extread, don't
check for uio_resid < 0 here too.
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index c90f450..848ac9d 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -975,14 +975,18 @@ ffs_extread(struct vnode *vp, struct uio *uio, int ioflag) #endif orig_resid = uio->uio_resid; - if (orig_resid <= 0) + if (orig_resid == 0) return (0); + /* + * The caller is supposed to check if + * uio->uio_offset >= 0 and uio->uio_resid >= 0. + */ bytesinfile = dp->di_extsize - uio->uio_offset; if (bytesinfile <= 0) { if ((vp->v_mount->mnt_flag & MNT_NOATIME) == 0) ip->i_flag |= IN_ACCESS; - return 0; + return (0); } for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) { |