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 B086A349B0C for ; Tue, 18 Nov 2025 17:22:08 +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=1763486531; cv=none; b=IWMv+4/ZgKlrpnUUoKraEzyB/Ui9eT8boU8bMlyMyZ8jm5AutrNitunKD1IgvnoNE8k3JrvonMI1cwB4Pn/JTnJfwl+PzDsNH3v1d5vZB/FGyMoOMb5JgJfrB/ULpAb9Uz6J9aGmpcqiGTWkI55jQnIMtAtzr6YYUrMpdnfawHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763486531; c=relaxed/simple; bh=zOuT/fvVI1Uo2wcDf08jgMp9IqHmCoA3MQw32Meyf4A=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=oGbgKvZcbotDCzTnJzfVWT7FU89Tv+sY5uXzqVyuoEHwe3Y77zrV7SGvq0OhhEN/sD/SyOjAa00I9jpAy0b2tWRRqiVgBLdtEhu2U24o9KKAdo/RurCBMq94TwqYd9iJX0uXew8vjxKAPXlkvzE4R88U7L+LLq3etN/ZvO32YxA= 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=Ep+le7n9; 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="Ep+le7n9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763486527; 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=r60MBtoVloBCd6KoFOodgdlMTkZazRJfHoRmernKj60=; b=Ep+le7n99kc6e4wifjAttOnmpy2WCJdML7w/+TKNcE1MmNKvM7twGOGKeyEtRh5dXquzrW MBkRKlgCgHP2nG2QEOOFnfw9JWwHkx7pYB/yJtHQN0YPChQEVEUMGsXLT1B1FbjcAKIZvP eJuxA4qYQJr63wygm10XZx6Wxss+P0A= 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-304-xfcU7BVhNzygwwKH_nhGZw-1; Tue, 18 Nov 2025 12:22:03 -0500 X-MC-Unique: xfcU7BVhNzygwwKH_nhGZw-1 X-Mimecast-MFC-AGG-ID: xfcU7BVhNzygwwKH_nhGZw_1763486522 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 6DDC219560AA; Tue, 18 Nov 2025 17:22:02 +0000 (UTC) Received: from [10.44.32.60] (unknown [10.44.32.60]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6B1BD1800451; Tue, 18 Nov 2025 17:21:59 +0000 (UTC) Date: Tue, 18 Nov 2025 18:21:56 +0100 (CET) From: Mikulas Patocka To: Benjamin Marzinski cc: Uladzislau Rezki , Alasdair Kergon , DMML , Andrew Morton , Mike Snitzer , Christoph Hellwig , LKML Subject: Re: [RESEND PATCH] dm-ebs: Mark full buffer dirty even on partial write In-Reply-To: Message-ID: <230baa83-cd79-f232-5fb8-1476115e1ae7@redhat.com> References: <20251117105945.10179-1-urezki@gmail.com> <73556fc8-5fbf-37cb-26b9-7cdb88f69720@redhat.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 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On Tue, 18 Nov 2025, Benjamin Marzinski wrote: > On Tue, Nov 18, 2025 at 01:00:36PM +0100, Mikulas Patocka wrote: > > > > > > On Tue, 18 Nov 2025, Uladzislau Rezki wrote: > > > > > Hello, Mikulas! > > > > > > > Hi > > > > > > > > What is the logical_block_size of the underlying nvme device? - i.e. > > > > what's the content of this file > > > > /sys/block/nvme0n1/queue/logical_block_size in the virtual machine? > > > > > > > It is 512. Whereas a physical is bigger, i.e. my device can not perform > > > I/O by 512 granularity. > > > > And what is physical block size? Is it 8192? > > > > > As for virtual machine, i just simulated the problem so people can set > > > it up and check. The commit message describes how it can be reproduced. > > > > > > The dm-ebs target which i setup does ebs to ubs conversion, so the NVME > > > driver gets BIOs are in size and aligned to ubs size. The ubs size > > > corresponds to the underlying physical device I/O size. > > > > > > So your patch does not work if logical < physical. Therefore it does > > > not help my project. > > > > Logical block size is the granularity at which the device can accept I/O. > > Physical block size is the block size on the medium. > > > > If logical < physical, then the device performs read-modify-write cycle > > when writing blocks that are not aligned at physical block size. > > > > So, your setup is broken, because it advertises logical block size 512, > > but it is not able to perform I/O at this granularity. > > This emulated nvme device is broken, but the question still remains, > "should dm-ebs enfore writing at the alignment that was specified in its > table line?" If you don't specify a ubs in the table line, it defaults > to the logical block size. So, if you do specify a ubs, it stands to > reason that you want IO at that alignment, instead of the logical-block > size (perhaps because your device is broken, and advertises the wrong > logical block size). > > So, I think that Uladzislau's patch makes sense, in addition to your > own. > > -Ben OK - I accepted Uladzislau's patch. As logical block size and physical block size seem to be unreliable, it's better to set the size in dm-ebs. Mikulas