public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH] loop: fix the the direct I/O support check when used on top of block devices
Date: Thu, 18 Jan 2024 16:21:11 +0800	[thread overview]
Message-ID: <Zajfd6ee6/ej0IRU@fedora> (raw)
In-Reply-To: <20240117175901.871796-1-hch@lst.de>

On Wed, Jan 17, 2024 at 06:59:01PM +0100, Christoph Hellwig wrote:
> __loop_update_dio only checks the alignment requirement for block backed
> file systems, but misses them for the case where the loop device is
> created directly on top of another block device.  Due to this creating
> a loop device with default option plus the direct I/O flag on a > 512 byte
> sector size file system will lead to incorrect I/O being submitted to the
> lower block device and a lot of error from the lock layer.  This can
> be seen with xfstests generic/563.
> 
> Fix the code in __loop_update_dio by factoring the alignment check into
> a helper, and calling that also for the struct block_device of a block
> device inode.
> 
> Also remove the TODO comment talking about dynamically switching between
> buffered and direct I/O, which is a would be a recipe for horrible
> performance and occasional data loss.
> 
> Fixes: 2e5ab5f379f9 ("block: loop: prepare for supporing direct IO")
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks one nice cleanup & fix:

Reviewed-by: Ming Lei <ming.lei@redhat.com>


Thanks,
Ming


  reply	other threads:[~2024-01-18  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 17:59 [PATCH] loop: fix the the direct I/O support check when used on top of block devices Christoph Hellwig
2024-01-18  8:21 ` Ming Lei [this message]
2024-01-18 15:21 ` Jens Axboe

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=Zajfd6ee6/ej0IRU@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox