diff -urNp linux-1290/fs/fcntl.c linux-1300/fs/fcntl.c --- linux-1290/fs/fcntl.c +++ linux-1300/fs/fcntl.c @@ -199,7 +199,7 @@ asmlinkage long sys_dup(unsigned int fil return ret; } -#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT) +#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC) static int setfl(int fd, struct file * filp, unsigned long arg) { @@ -222,25 +222,6 @@ static int setfl(int fd, struct file * f } } - if (arg & O_DIRECT) { - /* - * alloc_kiovec() can sleep and we are only serialized by - * the big kernel lock here, so abuse the i_sem to serialize - * this case too. We of course wouldn't need to go deep down - * to the inode layer, we could stay at the file layer, but - * we don't want to pay for the memory of a semaphore in each - * file structure too and we use the inode semaphore that we just - * pay for anyways. - */ - error = 0; - down(&inode->i_sem); - if (!filp->f_iobuf) - error = alloc_kiovec(1, &filp->f_iobuf); - up(&inode->i_sem); - if (error < 0) - return error; - } - /* required for strict SunOS emulation */ if (O_NONBLOCK != O_NDELAY) if (arg & O_NDELAY) diff -urNp linux-1290/fs/open.c linux-1300/fs/open.c --- linux-1290/fs/open.c +++ linux-1300/fs/open.c @@ -642,6 +642,8 @@ struct file *filp_open(const char * file { int namei_flags, error; struct nameidata nd; + + flags &= ~O_DIRECT; namei_flags = flags; if ((namei_flags+1) & O_ACCMODE)