linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Bob Peterson <rpeterso@redhat.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org
Subject: Hole punch races in GFS2
Date: Thu, 22 Apr 2021 13:26:12 +0200	[thread overview]
Message-ID: <20210422112612.GF26221@quack2.suse.cz> (raw)

Hello,

I am looking into how GFS2 protects against races between hole punching and
things like page fault or readahead and AFAICT it seems it does not. In
particular is there anything that protects against a race like:

CPU1					CPU2
gfs2_fallocate()
  __gfs2_punch_hole()
    truncate_pagecache_range()
					gfs2_fault()
					  - faults in old data into page
					    cache
    punch_hole()

And now we have stale data in the page cache (data corruption). If
gfs2_page_mkwrite() sneaked in that window as well, we might be even racing
with writeback and are possibly corrupting the filesystem on disk. Is there
anything I'm missing?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

                 reply	other threads:[~2021-04-22 11:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210422112612.GF26221@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rpeterso@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 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).