netfs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/netfs/read_collect: remove duplicate line
@ 2025-04-28 11:48 Max Kellermann
  2025-04-28 13:36 ` Paulo Alcantara
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Max Kellermann @ 2025-04-28 11:48 UTC (permalink / raw)
  To: dhowells, netfs, linux-kernel; +Cc: Max Kellermann

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

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
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(-)

diff --git a/fs/netfs/read_collect.c b/fs/netfs/read_collect.c
index 23c75755ad4e..422bfac47817 100644
--- a/fs/netfs/read_collect.c
+++ b/fs/netfs/read_collect.c
@@ -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) {
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs/netfs/read_collect: remove duplicate line
  2025-04-28 11:48 [PATCH] fs/netfs/read_collect: remove duplicate line Max Kellermann
@ 2025-04-28 13:36 ` Paulo Alcantara
       [not found] ` <notmuch-sha1-fe1ebcd5fc23eab1dc1cf15f4369d4b0ea567ded>
  2025-04-28 15:41 ` David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: Paulo Alcantara @ 2025-04-28 13:36 UTC (permalink / raw)
  To: Max Kellermann, dhowells, netfs, linux-kernel; +Cc: Max Kellermann

Max Kellermann <max.kellermann@ionos.com> writes:

> @@ -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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs/netfs/read_collect: remove duplicate line
       [not found] ` <notmuch-sha1-fe1ebcd5fc23eab1dc1cf15f4369d4b0ea567ded>
@ 2025-04-28 13:38   ` Paulo Alcantara
  0 siblings, 0 replies; 4+ messages in thread
From: Paulo Alcantara @ 2025-04-28 13:38 UTC (permalink / raw)
  To: Max Kellermann, dhowells, netfs, linux-kernel; +Cc: Max Kellermann

Paulo Alcantara <pc@manguebit.com> writes:

> Max Kellermann <max.kellermann@ionos.com> writes:
>
>> @@ -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,

Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs/netfs/read_collect: remove duplicate line
  2025-04-28 11:48 [PATCH] fs/netfs/read_collect: remove duplicate line Max Kellermann
  2025-04-28 13:36 ` Paulo Alcantara
       [not found] ` <notmuch-sha1-fe1ebcd5fc23eab1dc1cf15f4369d4b0ea567ded>
@ 2025-04-28 15:41 ` David Howells
  2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2025-04-28 15:41 UTC (permalink / raw)
  To: Max Kellermann; +Cc: dhowells, netfs, linux-kernel

Max Kellermann <max.kellermann@ionos.com> wrote:

> The `ret` variable has already been assigned before the `switch`
> block.
> 
> Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-28 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-28 11:48 [PATCH] fs/netfs/read_collect: remove duplicate line Max Kellermann
2025-04-28 13:36 ` Paulo Alcantara
     [not found] ` <notmuch-sha1-fe1ebcd5fc23eab1dc1cf15f4369d4b0ea567ded>
2025-04-28 13:38   ` Paulo Alcantara
2025-04-28 15:41 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).