]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r235781:
authortrasz <trasz@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 5 Jun 2012 20:27:41 +0000 (20:27 +0000)
committertrasz <trasz@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 5 Jun 2012 20:27:41 +0000 (20:27 +0000)
commita2d4181028c6adb39fda1e7723d256efdcd61901
treeb9f7642bd99ffcaf527245d4c4ca1e35a6408089
parent93b4b256f6b4dc74bbff4e4f1a975a80ddadfff5
MFC r235781:

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.

git-svn-id: svn://svn.freebsd.org/base/stable/9@236636 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c