Date: Sun, 8 May 2005 20:52:40 GMT From: Mark Blackman <mark@exonetric.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/80799: vnode disks don't play well with setrlimit Message-ID: <200505082052.j48KqelZ011733@www.freebsd.org> Resent-Message-ID: <200505082100.j48L0OBm055827@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 80799 >Category: misc >Synopsis: vnode disks don't play well with setrlimit >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 08 21:00:23 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Mark Blackman >Release: 4.11-STABLe >Organization: Exonetric >Environment: FreeBSD varadero.exonetric.net 4.11-STABLE FreeBSD 4.11-STABLE #2: Sat Apr 23 22:20:21 BST 2005 root@varadero.exonetric.net:/usr/obj/usr/src/sys/MAIN-NOSMP i386 >Description: Using the setrlimit call to limit maximum filesize (or other resource) on vnode-based (vn(4)) filesystem seems to leads to more restriction than the setrlimit call required. For instance setting a 1M byte filesize limit can lead to file too large errors even for a zero sized file. There also appears to be some relationship between the size of the vnode file image that provides the backing and the setrlimit value which allows you to create a zero-sized file. >How-To-Repeat: varadero# cd /dev varadero# sh MAKEDEV vn0 varadero# touch /tmp/testimage varadero# vnconfig -e -s labels -S 100m -Z vn0 /tmp/testimage varadero# disklabel -r -w vn0 auto varadero# newfs /dev/vn0c Warning: Block size restricts cylinders per group to 97. /dev/vn0c: 204800 sectors in 50 cylinders of 1 tracks, 4096 sectors 100.0MB in 1 cyl groups (97 c/g, 194.00MB/g, 12800 i/g) super-block backups (for fsck -b #) at: 32 varadero# mount /dev/vn0c /mnt varadero# limits -f 1024k touch /mnt/t1 zsh: file size limit exceeded limits -f 1024k touch /mnt/t1 varadero# limits -f 4096k touch /mnt/t1 varadero# ls -ld /mnt/t1 -rw-r--r-- 1 root wheel 0 May 8 21:42 /mnt/t1 >Fix: no known fix, just use a very large setrlimit value (or infinity) if having trouble creating files. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505082052.j48KqelZ011733>