From: Eric Sandeen <sandeen@redhat.com>
To: "Amit K. Arora" <aarora@linux.vnet.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>, Andreas Dilger <adilger@sun.com>,
Eelis <opensuse.org@contacts.eelis.net>,
Theodore Ts'o <tytso@mit.edu>,
Nikanth Karthikesan <knikanth@suse.de>,
coly.li@suse.de, Amit Arora <aarora@in.ibm.com>,
xfs@oss.sgi.com, Christoph Hellwig <hch@infradead.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH] New testcase to check if fallocate respects RLIMIT_FSIZE or not
Date: Tue, 04 May 2010 15:44:08 -0500 [thread overview]
Message-ID: <4BE08718.5040608@redhat.com> (raw)
In-Reply-To: <20100503083135.GC13756@amitarora.in.ibm.com>
Amit K. Arora wrote:
> On Sat, May 01, 2010 at 06:18:46AM -0400, Christoph Hellwig wrote:
>> On Sat, May 01, 2010 at 12:34:26PM +0530, Amit K. Arora wrote:
>>> Agreed. How about doing this check in the filesystem specific fallocate
>>> inode routines instead ? For example, in ext4 we could do :
>> That looks okay - in fact XFS should already have this check because
>> it re-uses the setattr implementation to set the size.
>>
>> Can you submit an xfstests testcase to verify this behaviour on all
>> filesystems?
>
> Here is the new testcase.
Thanks! A few comments...
> I have run this test on a x86_64 box on XFS and ext4 on 2.6.34-rc6. It
> passes on XFS, but fails on ext4. Below is the snapshot of results
> followed by the testcase itself.
>
> --
> Regards,
> Amit Arora
>
> Test results:
> ------------
> # ./check 228
> FSTYP -- xfs (non-debug)
> PLATFORM -- Linux/x86_64 elm9m93 2.6.34-rc6
>
> 228 0s ...
> Ran: 228
> Passed all 1 tests
> #
> # umount /mnt
> # mkfs.ext4 /dev/sda4 >/dev/null
> mke2fs 1.41.10 (10-Feb-2009)
> # ./check 228
> FSTYP -- ext4
> PLATFORM -- Linux/x86_64 elm9m93 2.6.34-rc6
>
> 228 0s ... - output mismatch (see 228.out.bad)
> --- 228.out 2010-05-03 02:51:24.000000000 -0400
> +++ 228.out.bad 2010-05-03 04:27:33.000000000 -0400
> @@ -1,2 +1 @@
> QA output created by 228
> -File size limit exceeded (core dumped)
> Ran: 228
> Failures: 228
> Failed 1 of 1 tests
> #
228.out is missing from the patch
Also on my fedora box I don't get a coredump by default; can
you either make that explicit, or filter out the core message?
>
> Here is the test:
> ----------------
> Add a new testcase to the xfstests suite to check if fallocate respects
> the limit imposed by RLIMIT_FSIZE (can be set by "ulimit -f XXX") or
> not, on a particular filesystem.
...
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./common.filter
Nitpick, I don't think you need common.filter, doesn't look like you are
using it.
> +# FSIZE limit is now set to 100 MB.
> +# Lets try to preallocate 101 MB. This should fail.
> +$XFS_IO_PROG -F -f -c 'falloc 0 101m' $TEST_DIR/ouch
> +rm -f $TEST_DIR/ouch
> +
> +# Lets now try to preallocate 50 MB. This should succeed.
> +$XFS_IO_PROG -F -f -c 'falloc 0 50m' $TEST_DIR/ouch
> +rm -f $TEST_DIR/ouch
Even more nitpicky, but sometimes I think it's nice to have the .out
file be a bit more descriptive in and of itself so when you see a
failing diff you have a better idea what's gone wrong.
Changing the comments to echos, like:
+# FSIZE limit is now set to 100 MB.
+# echo "Lets try to preallocate 101 MB. This should fail."
+$XFS_IO_PROG -F -f -c 'falloc 0 101m' $TEST_DIR/ouch
+rm -f $TEST_DIR/ouch
etc ... would make a failure look like:
--- 228.out 2010-05-04 15:42:31.924278768 -0500
+++ 228.out.bad 2010-05-04 15:42:36.961278392 -0500
@@ -1,3 +1,2 @@
QA output created by 228
Lets try to preallocate 101 MB. This should fail.
-File size limit exceeded
Lets now try to preallocate 50 MB. This should succeed.
... just a thought.
Thanks,
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-05-04 20:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201004281854.49730.knikanth@suse.de>
[not found] ` <4BD85F1F.7030100@suse.de>
[not found] ` <201004291014.07194.knikanth@suse.de>
[not found] ` <20100430143319.d51d6d77.akpm@linux-foundation.org>
[not found] ` <20100501070426.GA9562@amitarora.in.ibm.com>
[not found] ` <20100501101846.GA3769@infradead.org>
2010-05-03 8:31 ` [PATCH] New testcase to check if fallocate respects RLIMIT_FSIZE or not Amit K. Arora
2010-05-04 20:44 ` Eric Sandeen [this message]
2010-05-05 7:55 ` [PATCH v2] " Amit K. Arora
2010-05-05 15:50 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BE08718.5040608@redhat.com \
--to=sandeen@redhat.com \
--cc=aarora@in.ibm.com \
--cc=aarora@linux.vnet.ibm.com \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=coly.li@suse.de \
--cc=hch@infradead.org \
--cc=knikanth@suse.de \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=opensuse.org@contacts.eelis.net \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox