From: Yi Yang <yang.y.yi@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [2.6.18-rc* PATCH RFC]: Correct ambiguous errno of aio
Date: Tue, 29 Aug 2006 21:21:10 +0800 [thread overview]
Message-ID: <44F43F46.1070702@gmail.com> (raw)
Sorry, the last post is corrupted by email client, this is a repost.
In the current implementation of AIO, for the operation IOCB_CMD_FDSYNC
and IOCB_CMD_FSYNC, the returned errno is -EINVAL although the kernel
does know them, I think the correct errno should be -EOPNOTSUPP which
means they aren't be implemented or supported.
--- a/fs/aio.c.orig 2006-08-28 15:15:18.000000000 +0800
+++ b/fs/aio.c 2006-08-28 15:33:59.000000000 +0800
@@ -1363,20 +1363,10 @@ static ssize_t aio_pwrite(struct kiocb *
return ret;
}
-static ssize_t aio_fdsync(struct kiocb *iocb)
-{
- struct file *file = iocb->ki_filp;
- ssize_t ret = -EINVAL;
-
- if (file->f_op->aio_fsync)
- ret = file->f_op->aio_fsync(iocb, 1);
- return ret;
-}
-
static ssize_t aio_fsync(struct kiocb *iocb)
{
struct file *file = iocb->ki_filp;
- ssize_t ret = -EINVAL;
+ ssize_t ret = -EOPNOTSUPP;
if (file->f_op->aio_fsync)
ret = file->f_op->aio_fsync(iocb, 0);
@@ -1425,12 +1415,12 @@ static ssize_t aio_setup_iocb(struct kio
kiocb->ki_retry = aio_pwrite;
break;
case IOCB_CMD_FDSYNC:
- ret = -EINVAL;
+ ret = -EOPNOTSUPP;
if (file->f_op->aio_fsync)
- kiocb->ki_retry = aio_fdsync;
+ kiocb->ki_retry = aio_fsync;
break;
case IOCB_CMD_FSYNC:
- ret = -EINVAL;
+ ret = -EOPNOTSUPP;
if (file->f_op->aio_fsync)
kiocb->ki_retry = aio_fsync;
break;
next reply other threads:[~2006-08-29 13:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-29 13:21 Yi Yang [this message]
2006-08-29 18:32 ` [2.6.18-rc* PATCH RFC]: Correct ambiguous errno of aio Zach Brown
2006-08-29 19:04 ` Benjamin LaHaise
2006-08-30 14:19 ` [2.6.18-rc5 PATCH]: aio cleanup Yi Yang
2006-08-30 16:30 ` Zach Brown
[not found] ` <4c4443230608300651n34e8dbbdn8749c6874ce8791@mail.gmail.com>
2006-08-30 16:35 ` [2.6.18-rc* PATCH RFC]: Correct ambiguous errno of aio Zach Brown
-- strict thread matches above, loose matches on Subject: below --
2006-08-30 13:55 Yi Yang
2006-08-28 13:28 Yi Yang
2006-08-28 15:42 ` Randy.Dunlap
2006-08-28 16:08 ` Frederik Deweerdt
2006-08-28 14:55 ` Yi Yang
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=44F43F46.1070702@gmail.com \
--to=yang.y.yi@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox