From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org
Subject: Uninitialized extent races
Date: Fri, 21 Dec 2012 02:25:26 +0100 [thread overview]
Message-ID: <20121221012526.GD13474@quack.suse.cz> (raw)
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
next reply other threads:[~2012-12-21 1:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 1:25 Jan Kara [this message]
2012-12-21 3:11 ` Uninitialized extent races 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
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=20121221012526.GD13474@quack.suse.cz \
--to=jack@suse.cz \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
/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).