From: Omar Sandoval <osandov@osandov.com>
To: Hannes Reinecke <hare@suse.de>
Cc: linux-block@vger.kernel.org, Ming Lei <minlei@redhat.com>,
kernel-team@fb.com
Subject: Re: [RFC PATCH] loop: set queue logical block size
Date: Thu, 6 Apr 2017 08:48:34 -0700 [thread overview]
Message-ID: <20170406154834.GA405@vader> (raw)
In-Reply-To: <ba593363-672f-9d8b-986f-4eb9a11ab135@suse.de>
On Thu, Apr 06, 2017 at 10:52:01AM +0200, Hannes Reinecke wrote:
> On 04/06/2017 10:19 AM, Omar Sandoval wrote:
> > From: Omar Sandoval <osandov@fb.com>
> >
> > The request queue created when we create a loop device has the default
> > logical block size of 512. When we associate the device with an fd, we
> > set the block size on the block_device but don't update the logical
> > block size of the request_queue. This makes it impossibe to use direct
> > I/O with a backing file on a device with a block size >512, as the
> > following check in __loop_update_dio() fails:
> >
> > sb_bsize = bdev_logical_block_size(inode->i_sb->s_bdev);
> > if (queue_logical_block_size(lo->lo_queue) >= sb_bsize &&
> > ...
> >
> > Fix it by updating the logical block size when we set the fd.
> >
> > Signed-off-by: Omar Sandoval <osandov@fb.com>
> > ---
> > drivers/block/loop.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> > index cc981f34e017..1bb22903ad1a 100644
> > --- a/drivers/block/loop.c
> > +++ b/drivers/block/loop.c
> > @@ -941,6 +941,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
> > /* let user-space know about the new size */
> > kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
> >
> > + blk_queue_logical_block_size(lo->lo_queue, lo_blocksize);
> > set_blocksize(bdev, lo_blocksize);
> >
> > lo->lo_state = Lo_bound;
> >
> Gnaa.
>
> I've tried so change exactly this by my patchset titled 'loop: enable
> different logical blocksizes'.
> And I even got agreement from Jens to merge it once it got another
> review. Which, of course, no-one did.
Yours looks like a more complete solution, sorry that I missed it. I'll
take a look when you repost the patches.
prev parent reply other threads:[~2017-04-06 15:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 8:19 [RFC PATCH] loop: set queue logical block size Omar Sandoval
2017-04-06 8:43 ` Ming Lei
2017-04-06 12:03 ` Ming Lei
2017-04-06 12:21 ` Hannes Reinecke
2017-04-06 15:04 ` Ming Lei
2017-04-06 8:52 ` Hannes Reinecke
2017-04-06 15:48 ` Omar Sandoval [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=20170406154834.GA405@vader \
--to=osandov@osandov.com \
--cc=hare@suse.de \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=minlei@redhat.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 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.