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 7E50A2C08BC for ; Thu, 8 Jan 2026 12:14:47 +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=1767874490; cv=none; b=E5OMiL8dk29IJ5fdiauvzW6GcAkvdUEE1YCcOocqwJLXrnVAMxbWoDvn2/OPdSm52QkivYCq/pOANVbZT6Gj+R3llJlG48xi5yTK/9edzrcxsS1upgozaDZXxDAHOxhNGH3U2u0LtNPXFqEWC7iXimkJh1DXhRlgSoNmb6pXA4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767874490; c=relaxed/simple; bh=8OjR00LI97LjKvDNXw3KG6qSBV2UsnBXXlfmyFmZlxY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gJKkO7rGwFjCIduGrueuKqSszNDIoW4jkXCHlIaEidLBn0hWvImCyRhqxaVO254Yg7U6MmTcpNmpaJ9eXAWQexLIAliNpp4T1QOHuvfZB0+xXii2N+Q8krsdlQ9E0WoG7DwVc3cf2OGcDkeXnBsMb2T7RBdzaxzFOikZFgimOZU= 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=SBjSHFCQ; 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="SBjSHFCQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767874484; 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=t2qCFNA4/Erewu1t8D7IW9h5dHqTnH3aALQyYtKnmOM=; b=SBjSHFCQPkyVXx8GKdcy2/TocmINm1WJP6XZt/P5UhAjfTf/NyVHpoYEGSkZyky5yoLmyV a5ZI0mm/qsPd3C4HNTJlHE0DB1oTdYmwLZpajamu1pxzAuUYaJaNBAZkHhJ7dLMFWq7zxn 6xEhw5JMQVlBnUudeAvK59AcQTygdQ4= Received: from mx-prod-mc-05.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-561-AblKnrJkOPa--NQ8ZeZf2w-1; Thu, 08 Jan 2026 07:14:38 -0500 X-MC-Unique: AblKnrJkOPa--NQ8ZeZf2w-1 X-Mimecast-MFC-AGG-ID: AblKnrJkOPa--NQ8ZeZf2w_1767874477 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C8BE0195608D; Thu, 8 Jan 2026 12:14:36 +0000 (UTC) Received: from fedora (unknown [10.72.116.180]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1643F19560A2; Thu, 8 Jan 2026 12:14:29 +0000 (UTC) Date: Thu, 8 Jan 2026 20:14:23 +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 v4 03/19] ublk: support UBLK_PARAM_TYPE_INTEGRITY in device creation Message-ID: References: <20260108091948.1099139-1-csander@purestorage.com> <20260108091948.1099139-4-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: <20260108091948.1099139-4-csander@purestorage.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On Thu, Jan 08, 2026 at 02:19:31AM -0700, Caleb Sander Mateos wrote: > From: Stanley Zhang > > Add a feature flag UBLK_F_INTEGRITY for a ublk server to request > integrity/metadata support when creating a ublk device. The ublk server > can also check for the feature flag on the created device or the result > of UBLK_U_CMD_GET_FEATURES to tell if the ublk driver supports it. > UBLK_F_INTEGRITY requires UBLK_F_USER_COPY, as user copy is the only > data copy mode initially supported for integrity data. > Add UBLK_PARAM_TYPE_INTEGRITY and struct ublk_param_integrity to struct > ublk_params to specify the integrity params of a ublk device. > UBLK_PARAM_TYPE_INTEGRITY requires UBLK_F_INTEGRITY and a nonzero > metadata_size. The LBMD_PI_CAP_* and LBMD_PI_CSUM_* values from the > linux/fs.h UAPI header are used for the flags and csum_type fields. > If the UBLK_PARAM_TYPE_INTEGRITY flag is set, validate the integrity > parameters and apply them to the blk_integrity limits. > The struct ublk_param_integrity validations are based on the checks in > blk_validate_integrity_limits(). Any invalid parameters should be > rejected before being applied to struct blk_integrity. > > Signed-off-by: Stanley Zhang > [csander: drop redundant pi_tuple_size field, use block metadata UAPI > constants, add param validation] > Signed-off-by: Caleb Sander Mateos Reviewed-by: Ming Lei Thanks, Ming