ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] Possible fs corruption when hole punch races with other ops
Date: Wed, 21 Apr 2021 18:29:53 +0200	[thread overview]
Message-ID: <20210421162953.GA13863@quack2.suse.cz> (raw)

Hello,

I'm unifying protection various filesystems use to protect hole punch
operations from racing with other operations (like readahead, page fault,
writepage etc.). I was looking into OCFS2 and I think it is prone to a
following race which can possibly lead to filesystem corruption. But maybe
I miss something so that's why I'm writing here. The scenario I'm concerned
about is:

CPU1					CPU2
ocfs2_remove_inode_range()		ocfs2_writepage()
  ...					  block_write_full_page()
  ocfs2_remove_btree_range()		    ocfs2_extent_map_get_blocks()

Now ocfs2_extent_map_get_blocks() runs without protection of ip_alloc_sem
AFAICT and so both these operations can be modifying extent map at the same
time? What am I missing?

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

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

             reply	other threads:[~2021-04-21 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 16:29 Jan Kara [this message]
2021-04-22  3:22 ` [Ocfs2-devel] Possible fs corruption when hole punch races with other ops Joseph Qi
2021-04-22 10:44   ` Jan Kara
2021-04-22 15:56     ` Wengang Wang
2021-04-22 16:06       ` Darrick J. Wong
2021-04-22 16:36         ` Wengang Wang
2021-04-22 16:46           ` Darrick J. Wong

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=20210421162953.GA13863@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=ocfs2-devel@oss.oracle.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).