From: David Howells <dhowells@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: dhowells@redhat.com, Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Steve French <stfrench@microsoft.com>
Subject: Re: [GIT PULL] vfs netfs
Date: Mon, 16 Sep 2024 13:58:27 +0100 [thread overview]
Message-ID: <1888010.1726491507@warthog.procyon.org.uk> (raw)
In-Reply-To: <CAHk-=wjr8fxk20-wx=63mZruW1LTvBvAKya1GQ1EhyzXb-okMA@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > ++ netfs_read_subreq_terminated(&rdata->subreq, rdata->result, false);
>
> So here, I have
>
> ++ netfs_read_subreq_terminated(&rdata->subreq, rdata->result, true);
>
> with the third argument being 'true' instead of 'false' as in yours.
>
> The reason? That's what commit a68c74865f51 ("cifs: Fix SMB1
> readv/writev callback in the same way as SMB2/3") did when it moved
> the (originally) netfs_subreq_terminated() into the worker, and it
> changed the 'was_async' argument from "false" to a "true".
As part of these changes, the callback to netfslib from the SMB1 transport
variant is now delegated to a separate worker thread by cifs_readv_callback()
rather than being done in the cifs network processing thread (e.g. as is done
by the SMB2/3 smb2_readv_worker() in smb2pdu.c), so it's better to pass
"false" here.
All that argument does is tell netfslib whether it can do cleanup processing
and retrying in the calling thread (if "false") or whether it needs to
offload it to another thread (if "true"). I should probably rename the
argument from "was_async" to something more explanatory.
By putting "true" here, it causes the already offloaded processing to further
offload unnecessarily. It shouldn't break things though.
> > + rdata->subreq.transferred += rdata->got_bytes;
> > - netfs_read_subreq_terminated(&rdata->subreq, rdata->result, false);
> > ++ trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);
>
> where did this trace_netfs_sreq() come from?
It got copied across with other lines when sync'ing the code with
smb2_readv_callback() whilst attempting the merge resolution. It's something
that got missed out when porting the changes I'd made to SMB2/3 to SMB1. It
should have been deferred to a follow up patch.
> > --- a/fs/smb/client/smb2pdu.c
> > +++ b/fs/smb/client/smb2pdu.c
> > @@@ -4614,6 -4613,10 +4613,8 @@@ smb2_readv_callback(struct mid_q_entry
> > server->credits, server->in_flight,
> > 0, cifs_trace_rw_credits_read_response_clear);
> > rdata->credits.value = 0;
> > + rdata->subreq.transferred += rdata->got_bytes;
> > - if (rdata->subreq.start + rdata->subreq.transferred >= rdata->subreq.rreq->i_size)
> > - __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
> > + trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_progress);
>
> And where did this conflict resolution come from? I'm not seeing why
> it removes that NETFS_SREQ_HIT_EOF bit logic..
A fix that went upstream via SteveF's tree rather than Christian's tree added
NETFS_SREQ_HIT_EOF separately:
1da29f2c39b67b846b74205c81bf0ccd96d34727
netfs, cifs: Fix handling of short DIO read
The code that added to twiddle NETFS_SREQ_HIT_EOF is in the source, just above
the lines in the hunk above:
if (rdata->result == -ENODATA) {
__set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
rdata->result = 0;
} else {
size_t trans = rdata->subreq.transferred + rdata->got_bytes;
if (trans < rdata->subreq.len &&
rdata->subreq.start + trans == ictx->remote_i_size) {
__set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);
rdata->result = 0;
}
}
The two lines removed in the example resolution are therefore redundant and
should have been removed, but weren't.
David
next prev parent reply other threads:[~2024-09-16 12:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 16:56 Christian Brauner
2024-09-16 10:28 ` Linus Torvalds
2024-09-16 11:09 ` pr-tracker-bot
2024-09-16 12:58 ` David Howells [this message]
2024-09-16 13:50 ` [PATCH] cifs: Fix cifs readv callback merge resolution issue David Howells
2024-09-16 14:08 ` Linus Torvalds
2024-09-16 15:33 ` David Howells
2024-09-16 16:49 ` Linus Torvalds
2024-09-16 14:02 ` [PATCH] cifs: Remove redundant setting of NETFS_SREQ_HIT_EOF David Howells
2024-09-26 17:40 ` [GIT PULL] vfs netfs Leon Romanovsky
2024-09-27 8:01 ` David Howells
2024-09-27 16:34 ` Leon Romanovsky
2024-09-27 20:31 ` David Howells
2024-09-28 10:11 ` Leon Romanovsky
-- strict thread matches above, loose matches on Subject: below --
2025-06-02 10:11 Christian Brauner
2025-06-02 22:58 ` pr-tracker-bot
2025-01-18 12:55 Christian Brauner
2025-01-20 18:59 ` pr-tracker-bot
2024-11-15 14:00 Christian Brauner
2024-11-18 18:29 ` Linus Torvalds
2024-11-20 8:49 ` Christian Brauner
2024-11-20 17:09 ` Linus Torvalds
2024-11-20 19:53 ` Christian Brauner
2024-11-18 19:49 ` pr-tracker-bot
2024-05-10 11:47 Christian Brauner
2024-05-13 19:38 ` pr-tracker-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1888010.1726491507@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stfrench@microsoft.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome