From: Valentine Barshak <vbarshak@ru.mvista.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH] posix_fadvise bug (unexpected success on FIFO/pipe)
Date: Fri, 09 Dec 2005 15:58:04 +0300 [thread overview]
Message-ID: <43997F5C.1080700@ru.mvista.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 235 bytes --]
Hello all.
This patch adds a FIFO/pipe check to posix_fadvise system call.
If the specified file descriptor is pipe or FIFO, the system call
returns ESPIPE error.
Thank you.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
[-- Attachment #2: fadv.patch --]
[-- Type: text/x-patch, Size: 409 bytes --]
--- a/mm/fadvise.c 2005-10-10 22:54:29.000000000 +0400
+++ b/mm/fadvise.c 2005-12-06 23:04:19.980711464 +0300
@@ -37,6 +37,11 @@
if (!file)
return -EBADF;
+ if (S_ISFIFO(file->f_dentry->d_inode->i_mode)) {
+ ret = -ESPIPE;
+ goto out;
+ }
+
mapping = file->f_mapping;
if (!mapping || len < 0) {
ret = -EINVAL;
next reply other threads:[~2005-12-09 12:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-09 12:58 Valentine Barshak [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-12-08 16:44 [PATCH] posix_fadvise bug (unexpected success on FIFO/pipe) Valentine Barshak
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=43997F5C.1080700@ru.mvista.com \
--to=vbarshak@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--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