mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Jia Jia <physicalmtea@gmail.com>
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	virtualization@lists.linux.dev, kvm@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vhost-scsi: fix page reference leak in misaligned I/O fallback
Date: Wed, 21 Oct 2026 20:07:32 -0500	[thread overview]
Message-ID: <d58ea6de-e17c-4426-afd1-0b67ead16b7c@oracle.com> (raw)
In-Reply-To: <20261021085458.196742-1-physicalmtea@gmail.com>

On 10/21/26 3:54 AM, Jia Jia wrote:
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 4f8c0260bc9e..b7e41c0a91d4 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -883,11 +883,16 @@ vhost_scsi_map_to_sgl(struct vhost_scsi_cmd *cmd,
>   	vhost_scsi_revert_map_iov_to_sgl(iter, *sgl, sg);
>   
>   	iov_iter_revert(iter, bytes);
> +	/*
> +	 * pages[npages] is the first page not added to the SG list.  The

Just a minor nit. There's an extra space before "The" in the comment.

Patch looks ok otherwise. Thanks.

Reviewed-by: Mike Christie <michael.christie@oracle.com>


> +	 * remaining data starts at offset in that page.
> +	 */
>   	while (bytes) {
> -		n = min_t(unsigned int, PAGE_SIZE, bytes);
> +		n = min_t(unsigned int, PAGE_SIZE - offset, bytes);
>   
>   		put_page(pages[npages++]);
>   		bytes -= n;
> +		offset = 0;
>   	}
>   
>   	return -EINVAL;
> -- 
> 2.47.0
> 


      reply	other threads:[~2026-10-22  1:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  8:54 Jia Jia
2026-10-22  1:07 ` Mike Christie [this message]

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=d58ea6de-e17c-4426-afd1-0b67ead16b7c@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=eperezma@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=physicalmtea@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®