From: Dmitry Antipov <antipov@dev.rtsoft.ru>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] -EINVAL if no fasync op for file
Date: Thu, 18 Oct 2007 13:35:51 +0400 [thread overview]
Message-ID: <471728F7.6020809@dev.rtsoft.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
This patch proposes an additional error checking performed within setfl().
As a result, fcntl (fd, F_SETFL, O_ASYNC) will return -1 and set errno
to -EINVAL if filp->f_op->fasync is NULL for file specified by fd. This
is possible, for example, if fd is a descriptor returned by inotify_init().
Dmitry
[-- Attachment #2: 2.6.23-fcntl-fasync-check.patch --]
[-- Type: text/x-patch, Size: 352 bytes --]
Signed-off-by: Dmitry Antipov <antipov@dev.rtsoft.ru>
--- .orig-2.6.23/fs/fcntl.c 2007-10-17 15:26:06.000000000 +0400
+++ 2.6.23/fs/fcntl.c 2007-10-17 15:25:27.000000000 +0400
@@ -240,6 +240,9 @@
error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
if (error < 0)
goto out;
+ } else {
+ error = -EINVAL;
+ goto out;
}
}
next reply other threads:[~2007-10-18 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 9:35 Dmitry Antipov [this message]
2007-10-26 20:24 ` [PATCH] -EINVAL if no fasync op for file Andrew Morton
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=471728F7.6020809@dev.rtsoft.ru \
--to=antipov@dev.rtsoft.ru \
--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 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.