Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Stefan Metzmacher <metze@samba.org>
Cc: dhowells@redhat.com, linux-cifs@vger.kernel.org,
	Steve French <sfrench@samba.org>, Tom Talpey <tom@talpey.com>
Subject: Re: [PATCH 1/2] smb: client: fix max_sge overflow in smb_extract_folioq_to_rdma()
Date: Thu, 19 Jun 2025 12:41:53 +0100	[thread overview]
Message-ID: <850217.1750333313@warthog.procyon.org.uk> (raw)
In-Reply-To: <530e18dfe16eaba6fb66d9d8a9a93d50e99f5c1c.1750264849.git.metze@samba.org>

Stefan Metzmacher <metze@samba.org> wrote:

>  		if (offset < fsize) {
> -			size_t part = umin(maxsize - ret, fsize - offset);
> +			size_t part = umin(maxsize, fsize - offset);
>  
>  			if (!smb_set_sge(rdma, folio_page(folio, 0), offset, part))
>  				return -EIO;
>  
>  			offset += part;
>  			ret += part;
> +			maxsize -= part;

I don't think these two changes should make a difference.

>  		}
>  
>  		if (offset >= fsize) {
> @@ -2610,7 +2611,7 @@ static ssize_t smb_extract_folioq_to_rdma(struct iov_iter *iter,
>  				slot = 0;
>  			}
>  		}
> -	} while (rdma->nr_sge < rdma->max_sge || maxsize > 0);
> +	} while (rdma->nr_sge < rdma->max_sge && maxsize > 0);
>  
>  	iter->folioq = folioq;
>  	iter->folioq_slot = slot;

But this one definitely should!

Reviewed-by: David Howells <dhowells@redhat.com>


  reply	other threads:[~2025-06-19 11:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 16:51 [PATCH 0/2] smb: client: fix problems with smbdirect/rdma mounts Stefan Metzmacher
2025-06-18 16:51 ` [PATCH 1/2] smb: client: fix max_sge overflow in smb_extract_folioq_to_rdma() Stefan Metzmacher
2025-06-19 11:41   ` David Howells [this message]
2025-06-19 19:07     ` Tom Talpey
2025-06-18 16:51 ` [PATCH 2/2] smb: client: let smbd_post_send_iter() respect the peers max_send_size and transmit all data Stefan Metzmacher
2025-06-19 11:49   ` David Howells
2025-06-19 19:22   ` Tom Talpey
2025-06-20 12:29     ` David Howells
2025-06-20 13:33       ` Tom Talpey
2025-06-20 14:56         ` David Howells
2025-06-25  7:59       ` David Howells
2025-06-23 15:46     ` Stefan Metzmacher
2025-06-23 17:28       ` Steve French
2025-06-23 19:48         ` Sasha Levin
2025-06-25  8:00   ` David Howells

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=850217.1750333313@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=sfrench@samba.org \
    --cc=tom@talpey.com \
    /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