[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121221012526.GD13474@quack.suse.cz>
Date: Fri, 21 Dec 2012 02:25:26 +0100
From: Jan Kara <jack@...e.cz>
To: Dmitry Monakhov <dmonakhov@...nvz.org>
Cc: linux-ext4@...r.kernel.org
Subject: Uninitialized extent races
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@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists