From 849b4bb18bccbaf032e546ea773d0640a3cda8ca Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 24 Jun 2011 14:29:42 -0400 Subject: [PATCH] --- yaml --- r: 257377 b: refs/heads/master c: f9b5570d7fdedff32a2e78102bfb54cd1b12b289 h: refs/heads/master i: 257375: af62baea252c06282ba926012bbb5dce0005429c v: v3 --- [refs] | 2 +- trunk/fs/direct-io.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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;