archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <>
To: Ming Lei <>
Cc:, Jan Kara <>
Subject: Re: [PATCH V2] block: hold ->invalidate_lock in blkdev_fallocate
Date: Fri, 24 Sep 2021 11:07:11 -0600	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 9/22/21 8:37 PM, Ming Lei wrote:
> When running ->fallocate(), blkdev_fallocate() should hold
> mapping->invalidate_lock to prevent page cache from being accessed,
> otherwise stale data may be read in page cache.
> Without this patch, blktests block/009 fails sometimes. With this patch,
> block/009 can pass always.
> Also as Jan pointed out, no pages can be created in the discarded area
> while you are holding the invalidate_lock, so remove the 2nd
> truncate_bdev_range().

Applied, thanks.

Jens Axboe

  parent reply	other threads:[~2021-09-24 17:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  2:37 Ming Lei
2021-09-23 13:31 ` Jan Kara
2021-09-24 17:07 ` Jens Axboe [this message]
2021-11-09 10:46 ` Shinichiro Kawasaki

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH V2] block: hold ->invalidate_lock in blkdev_fallocate' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).