All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Eric Biggers <ebiggers@kernel.org>, pbonzini@redhat.com
Cc: qemu-devel@nongnu.org, hreitz@redhat.com, qemu-block@nongnu.org,
	Kevin Wolf <kwolf@redhat.com>,
	nsoffer@redhat.com
Subject: Re: [PATCH 2/2] file-posix: add statx(STATX_DIOALIGN) support
Date: Wed, 2 Nov 2022 14:53:24 -0400	[thread overview]
Message-ID: <Y2K8pJHgzx1sWJ7S@fedora> (raw)
In-Reply-To: <Y2HkziU7YVYv4KWJ@sol.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

On Tue, Nov 01, 2022 at 08:32:30PM -0700, Eric Biggers wrote:
> On Tue, Nov 01, 2022 at 03:00:31PM -0400, Stefan Hajnoczi wrote:
> >      /* Let's try to use the logical blocksize for the alignment. */
> > -    if (probe_logical_blocksize(fd, &bs->bl.request_alignment) < 0) {
> > -        bs->bl.request_alignment = 0;
> > +    if (!bs->bl.request_alignment) {
> > +        if (probe_logical_blocksize(fd, &bs->bl.request_alignment) < 0) {
> > +            bs->bl.request_alignment = 0;
> > +        }
> >      }
> >  
> >  #ifdef __linux__
> > -    /*
> > -     * The XFS ioctl definitions are shipped in extra packages that might
> > -     * not always be available. Since we just need the XFS_IOC_DIOINFO ioctl
> > -     * here, we simply use our own definition instead:
> > -     */
> > -    struct xfs_dioattr {
> > -        uint32_t d_mem;
> > -        uint32_t d_miniosz;
> > -        uint32_t d_maxiosz;
> > -    } da;
> > -    if (ioctl(fd, _IOR('X', 30, struct xfs_dioattr), &da) >= 0) {
> > -        bs->bl.request_alignment = da.d_miniosz;
> > -        /* The kernel returns wrong information for d_mem */
> > -        /* s->buf_align = da.d_mem; */
> > +    if (!bs->bl.request_alignment) {
> 
> This patch changes the fallback code to make the request_alignment value from
> probe_logical_blocksize() override the value from XFS_IOC_DIOINFO.  Is that
> intentional?

Thanks for pointing out the bug. That was not intentional. Will fix.

> > +        if (ioctl(fd, _IOR('X', 30, struct xfs_dioattr), &da) >= 0) {
> > +            bs->bl.request_alignment = da.d_miniosz;
> > +            /* The kernel returns wrong information for d_mem */
> > +            /* s->buf_align = da.d_mem; */
> 
> Has this bug been reported to the XFS developers (linux-xfs@vger.kernel.org)?

Paolo: Do you remember if you reported this when you wrote commit
c25f53b06eba ("raw: Probe required direct I/O alignment")?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2022-11-02 18:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 19:00 [PATCH 0/2] file-posix: alignment probing improvements Stefan Hajnoczi
2022-11-01 19:00 ` [PATCH 1/2] file-posix: fix Linux alignment probing when EIO is returned Stefan Hajnoczi
2022-11-02  2:27   ` Eric Biggers
2022-11-02  2:49     ` Eric Biggers
2022-11-02 18:50       ` Stefan Hajnoczi
2022-11-03  9:52       ` Kevin Wolf
2022-11-03 13:57         ` Stefan Hajnoczi
2022-11-03 16:26         ` Eric Biggers
2022-11-03 16:54           ` Eric Biggers
2022-11-03 17:54             ` Stefan Hajnoczi
2022-11-01 19:00 ` [PATCH 2/2] file-posix: add statx(STATX_DIOALIGN) support Stefan Hajnoczi
2022-11-02  3:32   ` Eric Biggers
2022-11-02 18:53     ` Stefan Hajnoczi [this message]

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=Y2K8pJHgzx1sWJ7S@fedora \
    --to=stefanha@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=nsoffer@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.