From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 975EA29BDA0 for ; Tue, 9 Dec 2025 03:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765252590; cv=none; b=EaltrXcIzUImZk4DCtw7MDWgi9bBlW/IR4SxdXzmI1K7mHD86ZiHoPx02qbjOUOHf9sxbMrbnPL8vyag4pn+qOzXaJY23WtDZE+a6J5PqrhR5YAGM9Fb5tgCcUGpl6j4Ddl/XGmSLVJRfdo3amYn2LJVe42QHR4bjukzcxd3QNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765252590; c=relaxed/simple; bh=Pt/yL8jhIuuI+Olw+LENAXuzzSVhwYgK2Vp/7fu6AO8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nOoCXwK9d1j+2095CEHrUajrhj/4jfm1/aHvQuzbmWljFPhCMowSwL1peAjb6YauF1gSwtWpdXuNBWJTMpYzSkhsA/yWKcfOoZglj+P0D3tDFwYAhIi7X0ycvOxqj8PA0S6YM1zthJ4TXQLp70BDxrXa4AB6bzJKZ+miN42UJLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Zno/e2QM; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Zno/e2QM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765252587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FlKzrZ6YiAKa1SyDGiDafkUHDxF+wGhpI9yBxR4dytk=; b=Zno/e2QM70TvBnWzfxZCSv8RmkXvtZoKp83LUZZ4kTrV5M6zGaOj/4Op634zjGiXfTlhGB JqoLz4Vsufvp/WPvdTebm0c1VZSFdoXDDVTpDmiDu8C4dWnobZCkEFeT+rLpC1KkiiVqii DSdc5VZbmkG9MsES/ukr8wPG+EOY5FM= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-7EhqRthtMwOosvwhO0Zgpg-1; Mon, 08 Dec 2025 22:56:20 -0500 X-MC-Unique: 7EhqRthtMwOosvwhO0Zgpg-1 X-Mimecast-MFC-AGG-ID: 7EhqRthtMwOosvwhO0Zgpg_1765252579 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AFB0119560B3; Tue, 9 Dec 2025 03:56:18 +0000 (UTC) Received: from fedora (unknown [10.72.116.98]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 23DB71956095; Tue, 9 Dec 2025 03:56:14 +0000 (UTC) Date: Tue, 9 Dec 2025 11:56:09 +0800 From: Ming Lei To: Caleb Sander Mateos Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ublk: don't mutate struct bio_vec in iteration Message-ID: References: <20251209031424.3412070-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251209031424.3412070-1-csander@purestorage.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On Mon, Dec 08, 2025 at 08:14:23PM -0700, Caleb Sander Mateos wrote: > __bio_for_each_segment() uses the returned struct bio_vec's bv_len field > to advance the struct bvec_iter at the end of each loop iteration. So > it's incorrect to modify it during the loop. Don't assign to bv_len (or > bv_offset, for that matter) in ublk_copy_user_pages(). > > Signed-off-by: Caleb Sander Mateos > Fixes: e87d66ab27ac ("ublk: use rq_for_each_segment() for user copy") Reviewed-by: Ming Lei Thanks, Ming