[PATCH 1/4] netfs: fix sense of DIO test on short read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The sense of this test is reversed. There's nothing that prevents
userland from requesting a DIO read that is longer than the available
data. Conversely, we don't expect a buffered read to be short unless it
hits the EOF.

Suggested-by: David Howells <dhowells@xxxxxxxxxx>
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 fs/netfs/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

David, feel free to fold this into the patch that adds the condition
so we can avoid the regression.

diff --git a/fs/netfs/io.c b/fs/netfs/io.c
index e5a15a924fc7..8188d43e8044 100644
--- a/fs/netfs/io.c
+++ b/fs/netfs/io.c
@@ -728,7 +728,7 @@ ssize_t netfs_begin_read(struct netfs_io_request *rreq, bool sync)
 
 		ret = rreq->error;
 		if (ret == 0 && rreq->submitted < rreq->len &&
-		    rreq->origin == NETFS_DIO_READ) {
+		    rreq->origin != NETFS_DIO_READ) {
 			trace_netfs_failure(rreq, NULL, ret, netfs_fail_short_read);
 			ret = -EIO;
 		}
-- 
2.36.1




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux