Skip to contentSkip to conversation

fs/netfs/read_collect: remove duplicate line

PATCH In review Max Kellermann 3 participants 4 messages Apr 28, 2025 1 message not in the archive Filesystems netfs library

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/netfs/read_collect: remove duplicate line

The ret variable has already been assigned before the switch block.

Fixes e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")
---
 fs/netfs/read_collect.c | 1 -
 1 file changed, 1 deletion(-)
fs/netfs/read_collect.c +0 -1
index 23c75755ad4e..422bfac47817 100644
@@ -653,7 +653,6 @@ ssize_t netfs_wait_for_read(struct netfs_io_request *rreq)
 		switch (rreq->origin) {
 		case NETFS_DIO_READ:
 		case NETFS_READ_SINGLE:
-			ret = rreq->transferred;
 			break;
 		default:
 			if (rreq->submitted < rreq->len) {
Signature · 1 line
2.47.2
#1 lore raw

fs/netfs/read_collect.c ssize_t netfs_wait_for_read(struct netfs_io_request *rreq) · line 658

Quoted 8 lines · Max Kellermann
fs/netfs/read_collect.c +0 -1
@@ -653,7 +653,6 @@ ssize_t netfs_wait_for_read(struct netfs_io_request *rreq)
 		switch (rreq->origin) {
 		case NETFS_DIO_READ:
 		case NETFS_READ_SINGLE:
-			ret = rreq->transferred;
 			break;
 		default:
 			if (rreq->submitted < rreq->len) {

This is wrong. @ret is expected to have the amount of bytes successfully read if no error.

A message that is not in the archive (sent off-list or not yet received): notmuch-sha1-fe1ebcd5fc23eab1dc1cf15f4369d4b0ea567ded

Reviewed-by
#3 lore raw
Quoted 13 lines · Paulo Alcantara

fs/netfs/read_collect.c ssize_t netfs_wait_for_read(struct netfs_io_request *rreq) · line 658

Quoted 8 lines · Max Kellermann
fs/netfs/read_collect.c +0 -1
@@ -653,7 +653,6 @@ ssize_t netfs_wait_for_read(struct netfs_io_request *rreq)
 		switch (rreq->origin) {
 		case NETFS_DIO_READ:
 		case NETFS_READ_SINGLE:
-			ret = rreq->transferred;
 			break;
 		default:
 			if (rreq->submitted < rreq->len) {

This is wrong. @ret is expected to have the amount of bytes successfully read if no error.

Err, sorry. I just saw the assignment right after if (ret == 0) check.

Looks good,

maintainer
#4 lore raw
In reply to Max Kellermann
Quoted 5 lines · Max Kellermann

The ret variable has already been assigned before the switch block.

Fixes e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")

Please hold off on this one. I want to submit the two patches at the bottom of here instead:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-fixes

netfs: Fix the request's work item to not require a ref
netfs: Fix wait/wake to be consistent about the waitqueue used

and this code gets moved and commonalised with the wait-for-write functions.

The reason I haven't posted them yet is that there may be an issue with cifs - and only in Steve's testfarm - though I'm not sure whether it's actually directly related to the changes here or whether it was masked just by it.

Thanks,
David