diff --git a/[refs] b/[refs] index 35522a31cd6a..7134bc146d61 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: be61a86d7237dd80510615f38ae21d6e1e98660c +refs/heads/master: 510df2dd482496083e1c3b1a8c9b6afd5fa4c7d7 diff --git a/trunk/fs/inotify_user.c b/trunk/fs/inotify_user.c index 851005998cd4..dc7e1f619748 100644 --- a/trunk/fs/inotify_user.c +++ b/trunk/fs/inotify_user.c @@ -574,7 +574,7 @@ asmlinkage long sys_inotify_init1(int flags) struct file *filp; int fd, ret; - if (flags & ~IN_CLOEXEC) + if (flags & ~(IN_CLOEXEC | IN_NONBLOCK)) return -EINVAL; fd = get_unused_fd_flags(flags & O_CLOEXEC); @@ -613,7 +613,7 @@ asmlinkage long sys_inotify_init1(int flags) filp->f_path.dentry = dget(inotify_mnt->mnt_root); filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping; filp->f_mode = FMODE_READ; - filp->f_flags = O_RDONLY; + filp->f_flags = O_RDONLY | (flags & O_NONBLOCK); filp->private_data = dev; INIT_LIST_HEAD(&dev->events); diff --git a/trunk/include/linux/inotify.h b/trunk/include/linux/inotify.h index 72ef82120512..bd578578a8b9 100644 --- a/trunk/include/linux/inotify.h +++ b/trunk/include/linux/inotify.h @@ -7,7 +7,7 @@ #ifndef _LINUX_INOTIFY_H #define _LINUX_INOTIFY_H -/* For O_CLOEXEC */ +/* For O_CLOEXEC and O_NONBLOCK */ #include #include @@ -67,6 +67,7 @@ struct inotify_event { /* Flags for sys_inotify_init1. */ #define IN_CLOEXEC O_CLOEXEC +#define IN_NONBLOCK O_NONBLOCK #ifdef __KERNEL__