summaryrefslogtreecommitdiff
path: root/drivers/xen/xenfs/xenbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xenfs/xenbus.c')
-rw-r--r--drivers/xen/xenfs/xenbus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/xen/xenfs/xenbus.c b/drivers/xen/xenfs/xenbus.c
index a9592d981b10..9d5b519d2e4c 100644
--- a/drivers/xen/xenfs/xenbus.c
+++ b/drivers/xen/xenfs/xenbus.c
@@ -122,6 +122,9 @@ static ssize_t xenbus_file_read(struct file *filp,
mutex_lock(&u->reply_mutex);
while (list_empty(&u->read_buffers)) {
mutex_unlock(&u->reply_mutex);
+ if (filp->f_flags & O_NONBLOCK)
+ return -EAGAIN;
+
ret = wait_event_interruptible(u->read_waitq,
!list_empty(&u->read_buffers));
if (ret)