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.133.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 70F572765F5 for ; Tue, 6 Jan 2026 13:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767707219; cv=none; b=klQCIdO67WeXgUSFEb0HYwB0HkaQoeUJ+f1p5r2tMkp5oPslUC5UCJfi1P4oClNgr4XDPci117nEYJ+wU7+v5nbMksPIqVfeSUPkYGDAH5nJ/B4GZKkWS2RrEKLhuho6pWmDXb7tmGh6nIlTFs0xSwf2sj39wOjGYPJmbDE17CM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767707219; c=relaxed/simple; bh=IFWtfZCxwnizNmOQ4YaunGOHc3Atsm5NGJ4J2TeJ1M0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Sfz7QVxFajpv83J7ZZz1ijn6ni44ZwNBkt3jERhsnJVSlETaG4/SYkFzHM8f4SXkZaUM7YOUfnrwy9B4LZhkc6hytiRVOxTLFiW93bCmK9+99FMpdkBlO/VFGEpJk9FhZLTwO/nXIPvpCG09Jij/jzhgaYbVxXY0KBIYqH2BCZk= 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=esEH+LEk; arc=none smtp.client-ip=170.10.133.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="esEH+LEk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767707216; 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=kYaObXGToIAIvRRny42n4tl1EbiM1ZMTYOqecmqvK/4=; b=esEH+LEk9huLwdLBHvAgdFCBAaP8RUCekI2gc0+4+LksPnMEnW0+8wfQhnc8DQNFJhWos5 pxKKL8PVyDXavIHNEzpIMHtvcuYfgVn2jdmXgWPWS/ZA/Y/7rhYaczJyapD4420qlEaCig 1l9GXed3xTVJr+3QnCDvKqsyvp84KPI= 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-632-0vLK66FFNKWjplHQY-aPkw-1; Tue, 06 Jan 2026 08:46:55 -0500 X-MC-Unique: 0vLK66FFNKWjplHQY-aPkw-1 X-Mimecast-MFC-AGG-ID: 0vLK66FFNKWjplHQY-aPkw_1767707214 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 DF02B195FCDC; Tue, 6 Jan 2026 13:46:53 +0000 (UTC) Received: from fedora (unknown [10.72.116.130]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 227B530001A8; Tue, 6 Jan 2026 13:46:45 +0000 (UTC) Date: Tue, 6 Jan 2026 21:46:40 +0800 From: Ming Lei To: Caleb Sander Mateos Cc: Jens Axboe , Shuah Khan , linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Stanley Zhang , Uday Shankar , "Martin K . Petersen" Subject: Re: [PATCH v3 09/19] ublk: implement integrity user copy Message-ID: References: <20260106005752.3784925-1-csander@purestorage.com> <20260106005752.3784925-10-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: <20260106005752.3784925-10-csander@purestorage.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On Mon, Jan 05, 2026 at 05:57:41PM -0700, Caleb Sander Mateos wrote: > From: Stanley Zhang > > Add a function ublk_copy_user_integrity() to copy integrity information > between a request and a user iov_iter. This mirrors the existing > ublk_copy_user_pages() but operates on request integrity data instead of > regular data. Check UBLKSRV_IO_INTEGRITY_FLAG in iocb->ki_pos in > ublk_user_copy() to choose between copying data or integrity data. > > Signed-off-by: Stanley Zhang > [csander: change offset units from data bytes to integrity data bytes, > test UBLKSRV_IO_INTEGRITY_FLAG after subtracting UBLKSRV_IO_BUF_OFFSET, > fix CONFIG_BLK_DEV_INTEGRITY=n build, > rebase on ublk user copy refactor] > Signed-off-by: Caleb Sander Mateos > --- > drivers/block/ublk_drv.c | 52 +++++++++++++++++++++++++++++++++-- > include/uapi/linux/ublk_cmd.h | 4 +++ > 2 files changed, 53 insertions(+), 3 deletions(-) > ... > diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h > index c1103ad5925b..3af7e3684834 100644 > --- a/include/uapi/linux/ublk_cmd.h > +++ b/include/uapi/linux/ublk_cmd.h > @@ -132,10 +132,14 @@ > #define UBLK_MAX_NR_QUEUES (1U << UBLK_QID_BITS) > > #define UBLKSRV_IO_BUF_TOTAL_BITS (UBLK_QID_OFF + UBLK_QID_BITS) > #define UBLKSRV_IO_BUF_TOTAL_SIZE (1ULL << UBLKSRV_IO_BUF_TOTAL_BITS) > > +/* Copy to/from request integrity buffer instead of data buffer */ > +#define UBLK_INTEGRITY_FLAG_OFF UBLKSRV_IO_BUF_TOTAL_BITS > +#define UBLKSRV_IO_INTEGRITY_FLAG (1ULL << UBLK_INTEGRITY_FLAG_OFF) UBLKSRV_IO_INTEGRITY_FLAG is actually one flag, not same with other encoded fields, maybe it is better to define it from top bit(62) and not mix with others? Then it can be helpful to extend in future. Thanks, Ming