public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
Subject: [PATCH] xfstests: fsx: fix fallocate logging
Date: Mon,  8 Aug 2011 11:55:14 -0400	[thread overview]
Message-ID: <1312818914-9950-1-git-send-email-josef@redhat.com> (raw)

I've been getting segfaults on fsx tests with btrfs because we're using the
wrong values for the logging with fallocate.  We were using the numbers 1,2 and
3 to indicate the type of preallocate we were doing, however we use these to
point to an array, so obviously array[3] for a 3 element array is wrong, so fix
these to do 0,1, and 2.  Also spit out of we're using KEEP_SIZE in the log to
make it easier to figure out what's going on.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 ltp/fsx.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 0683853..662af38 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -878,11 +878,11 @@ do_preallocate(unsigned offset, unsigned length)
 
 	/*
 	 * last arg:
-	 * 	1: allocate past EOF
-	 * 	2: extending prealloc
-	 * 	3: interior prealloc
+	 * 	0: allocate past EOF
+	 * 	1: extending prealloc
+	 * 	2: interior prealloc
 	 */
-	log4(OP_FALLOCATE, offset, length, (end_offset > file_size) ? (keep_size ? 1 : 2) : 3);
+	log4(OP_FALLOCATE, offset, length, (end_offset > file_size) ? (keep_size ? 0 : 1) : 2);
 
 	if (end_offset > file_size) {
 		memset(good_buf + file_size, '\0', end_offset - file_size);
@@ -895,7 +895,8 @@ do_preallocate(unsigned offset, unsigned length)
 	if ((progressinterval && testcalls % progressinterval == 0) ||
 	    (debug && (monitorstart == -1 || monitorend == -1 ||
 		      end_offset <= monitorend)))
-		prt("%lu falloc\tfrom 0x%x to 0x%x\n", testcalls, offset, length);
+		prt("%lu falloc\tfrom 0x%x to 0x%x%s\n", testcalls, offset, length,
+		    keep_size ? " (KEEP_SIZE)" : "");
 	if (fallocate(fd, keep_size ? FALLOC_FL_KEEP_SIZE : 0, (loff_t)offset, (loff_t)length) == -1) {
 	        prt("fallocate: %x to %x\n", offset, length);
 		prterr("do_preallocate: fallocate");
-- 
1.7.5.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2011-08-08 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 15:55 Josef Bacik [this message]
2011-08-09 10:06 ` [PATCH] xfstests: fsx: fix fallocate logging Dave Chinner
2011-08-09 12:03   ` Josef Bacik
2011-08-14 16:18   ` Christoph Hellwig

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=1312818914-9950-1-git-send-email-josef@redhat.com \
    --to=josef@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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