diff --git a/[refs] b/[refs] index 9fb92aa30de9..5b80199d209f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9ea7df534ed2a18157434a496a12cf073ca00c52 +refs/heads/master: f9b5570d7fdedff32a2e78102bfb54cd1b12b289 diff --git a/trunk/fs/direct-io.c b/trunk/fs/direct-io.c index ac5f164170e3..98ce3ac0d94b 100644 --- a/trunk/fs/direct-io.c +++ b/trunk/fs/direct-io.c @@ -1200,6 +1200,10 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, } } + /* watch out for a 0 len io from a tricksy fs */ + if (rw == READ && end == offset) + return 0; + dio = kmalloc(sizeof(*dio), GFP_KERNEL); retval = -ENOMEM; if (!dio) @@ -1213,8 +1217,7 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, dio->flags = flags; if (dio->flags & DIO_LOCKING) { - /* watch out for a 0 len io from a tricksy fs */ - if (rw == READ && end > offset) { + if (rw == READ) { struct address_space *mapping = iocb->ki_filp->f_mapping;