aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/ext2fs/ext2_vnops.c
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2013-07-09 14:23:00 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2013-07-09 14:23:00 +0000
commitdb20714a8790815d6d18de5a671ae8849342773c (patch)
tree82c56580791787615b2f53ef2b601dbe9edde0fd /sys/fs/ext2fs/ext2_vnops.c
parent56ce850bf896bbd688fafc3936d9c3fe81ac40a6 (diff)
downloadsrc-db20714a8790815d6d18de5a671ae8849342773c.tar.gz
src-db20714a8790815d6d18de5a671ae8849342773c.zip
Reinstate the assertion from r253045.
UFS r232732 reverted the change as the real problem was to be fixed at the syscall level. Reported by: bde
Notes
Notes: svn path=/head/; revision=253098
Diffstat (limited to 'sys/fs/ext2fs/ext2_vnops.c')
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index bf1253ed7f3a..00767540d7ca 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -1598,11 +1598,11 @@ ext2_read(struct vop_read_args *ap)
} else if (vp->v_type != VREG && vp->v_type != VDIR)
panic("%s: type %d", "ext2_read", vp->v_type);
#endif
- if (uio->uio_resid < 0 || uio->uio_offset < 0)
- return (EINVAL);
orig_resid = uio->uio_resid;
+ KASSERT(orig_resid >= 0, ("ext2_read: uio->uio_resid < 0"));
if (orig_resid == 0)
return (0);
+ KASSERT(uio->uio_offset >= 0, ("ext2_read: uio->uio_offset < 0"));
fs = ip->i_e2fs;
if (uio->uio_offset < ip->i_size &&
uio->uio_offset >= fs->e2fs_maxfilesize)