From: Christoph Hellwig <hch@infradead.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfsteststs: get fsstress DIO working on non-xfs filesystems
Date: Tue, 19 Jan 2010 04:13:16 -0500 [thread overview]
Message-ID: <20100119091316.GB24737@infradead.org> (raw)
In-Reply-To: <4B54C8AB.6080607@sandeen.net>
On Mon, Jan 18, 2010 at 02:46:35PM -0600, Eric Sandeen wrote:
> Pretty sure all DIO IO fails in fsstress today since XFS_IOC_DIOINFO
> fails. If so, rather than just bailing out on the op, assign
> some sane default DIO parameters.
>
> This falls down for 4k sector devices but not really sure how to get
> the underlying sector size easily from here; I think we can live
> with this for now.
>
> hch suggested moving XFS_IOC_DIOINFO up higher in the vfs, that's
> probably a good idea in the long run.
>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---
>
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 6978381..dab6bf7 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
> @@ -1818,9 +1818,9 @@ dread_f(int opno, long r)
> printf(
> "%d/%d: dread - xfsctl(XFS_IOC_DIOINFO) %s failed %d\n",
> procid, opno, f.path, errno);
> - free_pathname(&f);
> - close(fd);
> - return;
> + diob.d_maxiosz = -1U;
> + diob.d_miniosz = 512;
> + diob.d_mem = 512;
> }
> align = (__int64_t)diob.d_miniosz;
> lr = ((__int64_t)random() << 32) + random();
> @@ -1888,9 +1888,9 @@ dwrite_f(int opno, long r)
> printf("%d/%d: dwrite - xfsctl(XFS_IOC_DIOINFO)"
> " %s failed %d\n",
> procid, opno, f.path, errno);
> - free_pathname(&f);
> - close(fd);
> - return;
> + diob.d_maxiosz = -1U;
> + diob.d_miniosz = 512;
> + diob.d_mem = 512;
Can you factor out the alignment bits into a small helper and use it
in both places?
static void get_alignment(pathname_t *f, int fd, struct dioattr *dio)
{
if (xfsctl(f->path, fd, XFS_IOC_DIOINFO, dio) < 0) {
if (v)
printf(...);
/* use fallback values if the query fails. */
diob.d_maxiosz = -1U;
diob.d_miniosz = 512;
diob.d_mem = 512;
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-01-19 9:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 20:46 [PATCH] xfsteststs: get fsstress DIO working on non-xfs filesystems Eric Sandeen
2010-01-19 1:08 ` Dave Chinner
2010-01-19 9:13 ` Christoph Hellwig [this message]
2013-10-10 2:56 ` [PATCH V2] xfstests: " Eric Sandeen
2013-10-10 3:20 ` Dave Chinner
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=20100119091316.GB24737@infradead.org \
--to=hch@infradead.org \
--cc=sandeen@sandeen.net \
--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