From: Ted Ts'o <tytso@mit.edu>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [patch, resend] ext4: fix race between unwritten extent conversion and truncate
Date: Mon, 20 Feb 2012 23:00:07 -0500 [thread overview]
Message-ID: <20120221040007.GE25249@thunk.org> (raw)
In-Reply-To: <x49hayqy16f.fsf@segfault.boston.devel.redhat.com>
On Thu, Feb 16, 2012 at 03:26:48PM -0500, Jeff Moyer wrote:
> Hi,
>
> The following comment in ext4_end_io_dio caught my attention:
>
> /* XXX: probably should move into the real I/O completion handler */
> inode_dio_done(inode);
>
> The truncate code takes i_mutex, then calls inode_dio_wait. Because the
> ext4 code path above will end up dropping the mutex before it is
> reacquired by the worker thread that does the extent conversion, it
> seems to me that the truncate can happen out of order. Jan Kara
> mentioned that this might result in error messages in the system logs,
> but that should be the extent of the "damage."
>
> The fix is pretty straight-forward: don't call inode_dio_done until the
> extent conversion is complete.
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
> Reviewed-by: Jan Kara <jack@suse.cz>
Thanks, applied.
- Ted
prev parent reply other threads:[~2012-02-21 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 20:26 [patch, resend] ext4: fix race between unwritten extent conversion and truncate Jeff Moyer
2012-02-21 4:00 ` Ted Ts'o [this message]
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=20120221040007.GE25249@thunk.org \
--to=tytso@mit.edu \
--cc=jmoyer@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.