fs/direct-io.c: adjust suspicious bit operation
authorJulia Lawall <Julia.Lawall@lip6.fr>
Thu, 7 Jun 2012 22:45:00 +0000 (15:45 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Jul 2012 12:32:46 +0000 (16:32 +0400)
READ is 0, so the result of the bit-and operation is 0.  Rewrite with == as
done elsewhere in the same file.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/direct-io.c

index 0c85fae37666db4b18fb2bf9ebf692ae04bcbf40..1faf4cb56f3963d0945d8004b8640464b9e3b6fd 100644 (file)
@@ -1258,7 +1258,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
         */
        BUG_ON(retval == -EIOCBQUEUED);
        if (dio->is_async && retval == 0 && dio->result &&
-           ((rw & READ) || (dio->result == sdio.size)))
+           ((rw == READ) || (dio->result == sdio.size)))
                retval = -EIOCBQUEUED;
 
        if (retval != -EIOCBQUEUED)