lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 Aug 2009 15:19:41 +0200
From:	Jan Kara <jack@...e.cz>
To:	Theodore Tso <tytso@....edu>
Cc:	Jan Kara <jack@...e.cz>, Mingming <cmm@...ibm.com>,
	linux-ext4@...r.kernel.org, Eric Sandeen <sandeen@...hat.com>
Subject: Re: [PATCH 1/2 V2] Direct IO for holes and fallocate: add end_io
	callback

On Mon 24-08-09 15:11:38, Theodore Tso wrote:
> 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.
  Ah, right, I didn't realize that DIO end_io callback gets called from
an interrupt context only for async IO. That also explains why XFS is fine
doing the same thing. Thanks for the explanation.

								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