[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1Kfcb3-0003ra-Q7@be1.7eggert.dyndns.org>
Date: Tue, 16 Sep 2008 17:36:09 +0200
From: Bodo Eggert <7eggert@....de>
To: Manish Katiyar <mkatiyar@...il.com>,
Marco Stornelli <marco.stornelli@...itel.it>,
viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vfs: added better file aio_read aio_write operations presence check
Manish Katiyar <mkatiyar@...il.com> wrote:
> On Tue, Sep 16, 2008 at 2:59 PM, Marco Stornelli
>> From: Marco Stornelli <marco.stornelli@...il.com>
>> If a filesystem in the file operations specifies for read and write
>> operations only do_sync_read and do_sync_write without init aio_read and
>> aio_write, there will be a kernel oops, because the vfs code check the
>> presence of (to read for example) read OR aio_read method, then it calls read
>> if it's pointer is not null. It's not sufficient because if the read function
>> is actually a do_sync_read, it calls aio_read but without checking the
>> presence. I think a BUG_ON check can be more useful.
>
> Instead of doing a BUG_ON() why can't we simply fall back to the
> generic_aio functions since most of the fs tend to do so as below.
> --- a/fs/read_write.c
> - ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);
> + if (filp->f_op->aio_read)
> + ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);
> + else
> + ret = generic_file_aio_read(&kiocb, &iov, 1, kiocb.ki_pos);
Why can't the file system registration code set filp->f_op->aio_read to
generic_file_aio_read?
--
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