All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Jan Kara <jack@suse.cz>
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
	linux-fsdevel@vger.kernel.org,
	"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH] bdev: Do not return EBUSY if bdev discard races with write
Date: Tue, 26 Jan 2021 10:22:56 -0700	[thread overview]
Message-ID: <29be3d51-43b4-b4eb-66e0-669c517ed830@kernel.dk> (raw)
In-Reply-To: <20210126100215.GA10966@quack2.suse.cz>

On 1/26/21 3:02 AM, Jan Kara wrote:
> On Thu 07-01-21 16:40:34, Jan Kara wrote:
>> blkdev_fallocate() tries to detect whether a discard raced with an
>> overlapping write by calling invalidate_inode_pages2_range(). However
>> this check can give both false negatives (when writing using direct IO
>> or when writeback already writes out the written pagecache range) and
>> false positives (when write is not actually overlapping but ends in the
>> same page when blocksize < pagesize). This actually causes issues for
>> qemu which is getting confused by EBUSY errors.
>>
>> Fix the problem by removing this conflicting write detection since it is
>> inherently racy and thus of little use anyway.
>>
>> Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
>> CC: "Darrick J. Wong" <darrick.wong@oracle.com>
>> Link: https://lore.kernel.org/qemu-devel/20201111153913.41840-1-mlevitsk@redhat.com
>> Signed-off-by: Jan Kara <jack@suse.cz>
> 
> Jens, can you please pick up this patch? Thanks!

Picked it up for 5.12, hope that works. It looks simple enough but not
really meeting criteria for 5.11 at this point.

-- 
Jens Axboe


  reply	other threads:[~2021-01-27 13:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 15:40 [PATCH] bdev: Do not return EBUSY if bdev discard races with write Jan Kara
2021-01-07 15:48 ` Maxim Levitsky
2021-01-07 15:52   ` Maxim Levitsky
2021-01-07 19:40 ` Darrick J. Wong
2021-01-09 10:42 ` Christoph Hellwig
2021-01-26 10:02 ` Jan Kara
2021-01-26 17:22   ` Jens Axboe [this message]
2021-01-27  9:12     ` Jan Kara

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=29be3d51-43b4-b4eb-66e0-669c517ed830@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=darrick.wong@oracle.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mlevitsk@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.