posix_fadvise bug (unexpected success on FIFO/pipe)
Subsystems (2)
PATCH 1/1 posix_fadvise bug (unexpected success on FIFO/pipe)
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 <[email protected]>
mm/fadvise.c 2005-12-06 23:04:19.980711464 +0300 renamed from mm/fadvise.c 2005-10-10 22:54:29.000000000 +0400 +5 -0
@@ -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;