From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Cc: Jiaying Zhang <jiayingz@google.com>
Subject: [PATCH] ext4: queue conversion after adding to inode's completed IO list
Date: Fri, 06 Aug 2010 15:52:29 -0400 [thread overview]
Message-ID: <4C5C67FD.5070208@redhat.com> (raw)
By queuing the io end on the unwritten workqueue before adding it
to our inode's list of completed IOs, I think we run the risk
of the work getting completed, and the IO freed, before we try
to add it to the inode's i_completed_io_list.
It should be safe to add it to the inode's list of completed
IOs, and -then- queue it for completion, I think.
Thanks to Dave Chinner for pointing out the race.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
(At least I think this is right; I haven't actually demonstrated a race...)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 0afc8c1..7f56c48 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3804,14 +3804,14 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,
io_end->flag = EXT4_IO_UNWRITTEN;
wq = EXT4_SB(io_end->inode->i_sb)->dio_unwritten_wq;
- /* queue the work to convert unwritten extents to written */
- queue_work(wq, &io_end->work);
next reply other threads:[~2010-08-06 19:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 19:52 Eric Sandeen [this message]
2010-08-06 20:45 ` [PATCH] ext4: queue conversion after adding to inode's completed IO list Jiaying Zhang
2010-10-07 17:23 ` Eric Sandeen
2010-10-09 23:14 ` Ted Ts'o
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=4C5C67FD.5070208@redhat.com \
--to=sandeen@redhat.com \
--cc=jiayingz@google.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.