public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs mailing list <xfs@oss.sgi.com>
Cc: Josef Bacik <jbacik@redhat.com>
Subject: [PATCH 1/2] xfstests: fix fiemap-tester for fewer extents returned
Date: Thu, 24 Feb 2011 16:02:06 -0600	[thread overview]
Message-ID: <4D66D55E.8070209@redhat.com> (raw)

If the fiemap call returns fewer extents than asked for,
the fiemap tester gets confused.  If this happens, advance,
and call fiemap again for the next offset.

XFS exposed this because if a file is all-delalloc, it was
only returning 1 mapped extent (this is probably also a buglet).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/src/fiemap-tester.c b/src/fiemap-tester.c
index f6875af..53d7a64 100644
--- a/src/fiemap-tester.c
+++ b/src/fiemap-tester.c
@@ -467,8 +467,10 @@ compare_fiemap_and_map(int fd, char *map, int blocks, int blocksize)
 		for (i = cur_extent, c = 1; i < blocks; i++, c++) {
 			__u64 logical_offset = i * blocksize;
 
-			if (c > blocks_to_map)
+			if (c > fiemap->fm_mapped_extents) {
+				i++;
 				break;
+			}
 
 			switch (map[i]) {
 			case 'D':

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

             reply	other threads:[~2011-02-24 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 22:02 Eric Sandeen [this message]
2011-02-25 20:47 ` [PATCH 1/2] xfstests: fix fiemap-tester for fewer extents returned Alex Elder

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=4D66D55E.8070209@redhat.com \
    --to=sandeen@redhat.com \
    --cc=jbacik@redhat.com \
    --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