Commit d187663e authored by Julia Lawall's avatar Julia Lawall Committed by Al Viro

fs/direct-io.c: adjust suspicious bit operation

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: default avatarJulia Lawall <julia@diku.dk>
Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3dd84782
...@@ -1258,7 +1258,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, ...@@ -1258,7 +1258,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
*/ */
BUG_ON(retval == -EIOCBQUEUED); BUG_ON(retval == -EIOCBQUEUED);
if (dio->is_async && retval == 0 && dio->result && if (dio->is_async && retval == 0 && dio->result &&
((rw & READ) || (dio->result == sdio.size))) ((rw == READ) || (dio->result == sdio.size)))
retval = -EIOCBQUEUED; retval = -EIOCBQUEUED;
if (retval != -EIOCBQUEUED) if (retval != -EIOCBQUEUED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment