]> www.infradead.org Git - users/hch/block.git/commitdiff
cifs: Don't advance the I/O iterator before terminating subrequest
authorDavid Howells <dhowells@redhat.com>
Fri, 31 May 2024 14:53:42 +0000 (15:53 +0100)
committerSteve French <stfrench@microsoft.com>
Fri, 7 Jun 2024 06:05:26 +0000 (01:05 -0500)
There's now no need to make sure subreq->io_iter is advanced to match
subreq->transferred before calling one of the netfs subrequest termination
functions as the check has been removed netfslib and the iterator is reset
prior to retrying a subreq.

Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2pdu.c

index 993ac36c3d585ae7fa740300e60d27b481ebebe4..38a06e8a0f90f9164341d2635d07088b9a3d4f89 100644 (file)
@@ -4577,8 +4577,6 @@ smb2_readv_callback(struct mid_q_entry *mid)
                if (rdata->subreq.start < rdata->subreq.rreq->i_size)
                        rdata->result = 0;
        }
-       if (rdata->result == 0 || rdata->result == -EAGAIN)
-               iov_iter_advance(&rdata->subreq.io_iter, rdata->got_bytes);
        rdata->credits.value = 0;
        netfs_subreq_terminated(&rdata->subreq,
                                (rdata->result == 0 || rdata->result == -EAGAIN) ?
@@ -4789,7 +4787,6 @@ smb2_writev_callback(struct mid_q_entry *mid)
                        wdata->result = -ENOSPC;
                else
                        wdata->subreq.len = written;
-               iov_iter_advance(&wdata->subreq.io_iter, written);
                break;
        case MID_REQUEST_SUBMITTED:
        case MID_RETRY_NEEDED: