linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Uninitialized extent races
@ 2012-12-21  1:25 Jan Kara
  2012-12-21  3:11 ` Theodore Ts'o
  2012-12-21 12:34 ` Dmitry Monakhov
  0 siblings, 2 replies; 12+ messages in thread
From: Jan Kara @ 2012-12-21  1:25 UTC (permalink / raw)
  To: Dmitry Monakhov; +Cc: linux-ext4

  Hello,

  I was looking into handling of unwritten extents and I've noticed two
things:
1) Commit 60d4616f added ext4_flush_unwritten_io() call into
   ext4_fallocate() with a comment that it should avoid a race between
   AIO DIO and fallocate. But that really doesn't completely fix the issue
   because writeback can create unwritten extents as well and that is not
   synchronized with i_mutex unlike AIO DIO.

2) Commit dee1f973 actually changed ext4_convert_unwritten_extents_endio()
   to be able to deal with the situation when extent we want to convert
   isn't exactly the one in the extent tree (i.e., it was merged with
   another extent in the mean time). That was the situation 1) tried to
   prevent so it seems to make ext4_flush_unwritten_io() call from 1)
   unnecessary?

Am I missing something Dmitry? Also I was wondering about one thing: Does
anybody see a problem with disabling merging of uninitialized extents
completely? It would simplify the code (end_io conversion doesn't need to
potentially split extents) and the case when we really want to merge
extents - i.e., when someone calls fallocate() on small chunks - doesn't
seem like the case we need to optimize for? Also it would bound the amount of
transaction credits we need for conversion to 1 block which would make it
easier for me to change ext4 to clear PageWriteback only after extent
conversion is done (again code simplification, more uniform handling of
page writeback).

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

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

end of thread, other threads:[~2013-01-01  4:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-21  1:25 Uninitialized extent races Jan Kara
2012-12-21  3:11 ` Theodore Ts'o
2012-12-21 16:19   ` Jan Kara
2012-12-21 18:02     ` Theodore Ts'o
2012-12-21 22:49       ` Jan Kara
2012-12-21 23:03         ` Theodore Ts'o
2012-12-24 11:17       ` Zheng Liu
2012-12-31  8:32         ` Jan Kara
2012-12-31 16:31           ` Zheng Liu
2012-12-31 16:44             ` Jan Kara
2013-01-01  4:49               ` Zheng Liu
2012-12-21 12:34 ` Dmitry Monakhov

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