ffs_vnops.c (125259) | ffs_vnops.c (125454) |
---|---|
1/* 2 * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by Marshall 6 * Kirk McKusick and Network Associates Laboratories, the Security 7 * Research Division of Network Associates, Inc. under DARPA/SPAWAR 8 * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS --- 29 unchanged lines hidden (view full) --- 38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 * 42 * @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95 43 */ 44 45#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by Marshall 6 * Kirk McKusick and Network Associates Laboratories, the Security 7 * Research Division of Network Associates, Inc. under DARPA/SPAWAR 8 * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS --- 29 unchanged lines hidden (view full) --- 38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 * 42 * @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95 43 */ 44 45#include <sys/cdefs.h> |
46__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_vnops.c 125259 2004-01-31 05:42:58Z alc $"); | 46__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_vnops.c 125454 2004-02-04 21:52:57Z jhb $"); |
47 48#include <sys/param.h> 49#include <sys/bio.h> 50#include <sys/systm.h> 51#include <sys/buf.h> 52#include <sys/conf.h> 53#include <sys/extattr.h> 54#include <sys/kernel.h> --- 574 unchanged lines hidden (view full) --- 629 if ((uoff_t)uio->uio_offset + uio->uio_resid > fs->fs_maxfilesize) { 630 return (EFBIG); 631 } 632 /* 633 * Maybe this should be above the vnode op call, but so long as 634 * file servers have no limits, I don't think it matters. 635 */ 636 td = uio->uio_td; | 47 48#include <sys/param.h> 49#include <sys/bio.h> 50#include <sys/systm.h> 51#include <sys/buf.h> 52#include <sys/conf.h> 53#include <sys/extattr.h> 54#include <sys/kernel.h> --- 574 unchanged lines hidden (view full) --- 629 if ((uoff_t)uio->uio_offset + uio->uio_resid > fs->fs_maxfilesize) { 630 return (EFBIG); 631 } 632 /* 633 * Maybe this should be above the vnode op call, but so long as 634 * file servers have no limits, I don't think it matters. 635 */ 636 td = uio->uio_td; |
637 if (vp->v_type == VREG && td && 638 uio->uio_offset + uio->uio_resid > 639 td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) { | 637 if (vp->v_type == VREG && td != NULL) { |
640 PROC_LOCK(td->td_proc); | 638 PROC_LOCK(td->td_proc); |
641 psignal(td->td_proc, SIGXFSZ); | 639 if (uio->uio_offset + uio->uio_resid > 640 lim_cur(td->td_proc, RLIMIT_FSIZE)) { 641 psignal(td->td_proc, SIGXFSZ); 642 PROC_UNLOCK(td->td_proc); 643 return (EFBIG); 644 } |
642 PROC_UNLOCK(td->td_proc); | 645 PROC_UNLOCK(td->td_proc); |
643 return (EFBIG); | |
644 } 645 646 resid = uio->uio_resid; 647 osize = ip->i_size; 648 if (seqcount > BA_SEQMAX) 649 flags = BA_SEQMAX << BA_SEQSHIFT; 650 else 651 flags = seqcount << BA_SEQSHIFT; --- 1138 unchanged lines hidden --- | 646 } 647 648 resid = uio->uio_resid; 649 osize = ip->i_size; 650 if (seqcount > BA_SEQMAX) 651 flags = BA_SEQMAX << BA_SEQSHIFT; 652 else 653 flags = seqcount << BA_SEQSHIFT; --- 1138 unchanged lines hidden --- |