Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / fs / fcntl.c
index ee85cd4..350a2c8 100644 (file)
@@ -51,7 +51,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
               if (arg & O_NDELAY)
                   arg |= O_NONBLOCK;
 
-       if (arg & O_DIRECT) {
+       /* Pipe packetized mode is controlled by O_DIRECT flag */
+       if (!S_ISFIFO(filp->f_inode->i_mode) && (arg & O_DIRECT)) {
                if (!filp->f_mapping || !filp->f_mapping->a_ops ||
                        !filp->f_mapping->a_ops->direct_IO)
                                return -EINVAL;