[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4561C60B.5000106@oracle.com>
Date: Mon, 20 Nov 2006 07:13:15 -0800
From: Zach Brown <zach.brown@...cle.com>
To: Sébastien Dugué <sebastien.dugue@...l.net>
CC: linux-kernel <linux-kernel@...r.kernel.org>,
linux-aio <linux-aio@...ck.org>, Andrew Morton <akpm@...l.org>,
Suparna Bhattacharya <suparna@...ibm.com>,
Christoph Hellwig <hch@...radead.org>,
Badari Pulavarty <pbadari@...ibm.com>,
Jean Pierre Dion <jean-pierre.dion@...l.net>,
Ulrich Drepper <drepper@...hat.com>
Subject: Re: [PATCH -mm 3/4][AIO] - AIO completion signal notification
Sébastien Dugué wrote:
> AIO completion signal notification
This is looking a lot better, thanks for keeping at it.
> +static long aio_setup_sigevent(struct aio_notify *notify,
> + struct sigevent __user *user_event)
> +{
> + sigevent_t event;
> + struct task_struct *target;
> +
> + if (copy_from_user(&event, user_event, sizeof (event)))
> + return -EFAULT;
Last time we talked about this needing to call get_compat_sigevent(). I
think it still needs to.
I think we should avoid the examples set by the current
compat_sys_io_submit() and get_compat_sigevent() callers. They copy
translated data on to the userspace stack and pass it to the syscalls.
That will get crazy for compat_sys_io_submit() because it would have to
rewrite the iocb and the pointer to the iocb to get sys_io_submit() to
find a copied sigevent on the stack.
I think the model is compat_do_readv_writev(). Hoist some of the
syscall logic up into the compat layer so that one copying and
translating pass is made instead of trying to fool the syscall logic
into thinking that it's being called from a native word size caller.
So io_submit_one() should be given the kernel copies of the userspace
structures it needs. sys_io_submit() will pass it the copies it made
for native word size callers. compat_sys_io_submit() will pass in the
copies it made after translating from 32bit arguments. io_submit_one()
and lookup_kioctx() will have to be made available to kernel/compat.c
(via linux/aio.h, surely.). aio_setup_sigevent() will be called from
*_io_submit() and given the kernel sigevent, not a userspace pointer.
Reworking things this way should have the added benefit of making 32/64
sys_io_submit() more efficient than it is today.
- z
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists