freebsd-skq/sys/cddl
Edward Tomasz Napierala 9280affe16 Fix enforcement of file size limit with O_APPEND on ZFS.
vn_rlimit_fsize takes uio->uio_offset and uio->uio_resid into account
when determining whether given write would exceed RLIMIT_FSIZE.

When APPEND flag is specified, ZFS updates uio->uio_offset to point to the
end of file.

But this happens after a call to vn_rlimit_fsize, so vn_rlimit_fsize check
can be rendered ineffective by thread that opens some file with O_APPEND
and lseeks below RLIMIT_FSIZE before calling write.

Submitted by:	Mateusz Guzik <mjguzik at gmail dot com>
MFC after:	2 weeks
2012-05-22 10:54:42 +00:00
..
boot/zfs add a zfs spa_t change missed in r235329 2012-05-12 16:36:54 +00:00
compat/opensolaris Fix found places where uio_resid is truncated to int. 2012-02-21 01:05:12 +00:00
contrib/opensolaris Fix enforcement of file size limit with O_APPEND on ZFS. 2012-05-22 10:54:42 +00:00
dev Instead of only iterating over the set of known SDT probes when sdt.ko is 2012-03-27 15:07:43 +00:00