ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] Possible fs corruption when hole punch races with other ops
@ 2021-04-21 16:29 Jan Kara
  2021-04-22  3:22 ` Joseph Qi
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2021-04-21 16:29 UTC (permalink / raw)
  To: Joseph Qi; +Cc: ocfs2-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-22 16:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 16:29 [Ocfs2-devel] Possible fs corruption when hole punch races with other ops Jan Kara
2021-04-22  3:22 ` 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

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).