From: Valentine Barshak Date: Sun, 8 Jan 2006 09:03:44 +0000 (-0800) Subject: [PATCH] fadvise: return ESPIPE on FIFO/pipe X-Git-Tag: Ubuntu-goldfish-3.4.0-4.27~36937 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=87ba81dba431232548ce29d5d224115d0c2355ac;p=mirror_ubuntu-zesty-kernel.git [PATCH] fadvise: return ESPIPE on FIFO/pipe The patch makes posix_fadvise return ESPIPE on FIFO/pipe in order to be fully POSIX-compliant. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/fadvise.c b/mm/fadvise.c index 5f19e87bc5af..d257c89e7704 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -37,6 +37,11 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) 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;