From: Theodore Tso <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Mingming <cmm@us.ibm.com>,
linux-ext4@vger.kernel.org, Eric Sandeen <sandeen@redhat.com>
Subject: Re: [PATCH 1/2 V2] Direct IO for holes and fallocate: add end_io callback
Date: Mon, 24 Aug 2009 15:11:38 -0400 [thread overview]
Message-ID: <20090824191137.GA19624@mit.edu> (raw)
In-Reply-To: <20090819141557.GA4705@atrey.karlin.mff.cuni.cz>
On Wed, Aug 19, 2009 at 04:15:57PM +0200, Jan Kara wrote:
> > +static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,
> > + ssize_t size, void *private)
> > +{
> > + ext4_io_end_t *io_end = iocb->private;
> > + struct workqueue_struct *wq;
> > +
> > + /* if not hole or unwritten extents, just simple return */
> > + if (!io_end || !size)
> > + return;
> > + io_end->offset = offset;
> > + io_end->size = size;
> > + wq = EXT4_SB(io_end->inode->i_sb)->dio_unwritten_wq;
> > +
> > + /* We need to convert unwritten extents to written */
> > + queue_work(wq, &io_end->work);
> > +
> > + if (is_sync_kiocb(iocb))
> > + flush_workqueue(wq);
> I don't think you can flush_workqueue here. end_io is called from
> interrupt context and flush_workqueue blocks for a long time...
> The wait should be done in ext4_direct_IO IMHO...
I don't see a problem here? This is a direct_io end_io callback, not
a bio callback; so it's only called from an interrupt context in the
async I/O case, and we only call flush_workqueue() when the kiocb is
synchronous.
- Ted
next prev parent reply other threads:[~2009-08-24 19:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 15:54 [PATCH 1/2 V2] Direct IO for holes and fallocate: add end_io callback Mingming
2009-08-19 14:15 ` Jan Kara
2009-08-19 21:26 ` Mingming
2009-08-20 11:52 ` Jan Kara
2009-08-24 21:38 ` Mingming
2009-08-25 14:01 ` Jan Kara
2009-08-25 19:41 ` Mingming
2009-08-26 0:49 ` Mingming
2009-08-26 13:39 ` Jan Kara
2009-08-26 13:52 ` Jan Kara
2009-09-04 0:44 ` [PATCH 1/2 V3] handle unwritten extents spt for direct IO Mingming
2009-08-24 19:11 ` Theodore Tso [this message]
2009-08-25 13:19 ` [PATCH 1/2 V2] Direct IO for holes and fallocate: add end_io callback Jan Kara
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=20090824191137.GA19624@mit.edu \
--to=tytso@mit.edu \
--cc=cmm@us.ibm.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
/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.