Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2090744lqz; Tue, 2 Apr 2024 07:05:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTjH9592Xw3A7C46QhnZ+veca7JnfF8aTfPPEWDXz0joaYnF3uzlAC//EzIzSaW83hGbqrZo+S9sTYxtXePLwMm0v3FJgQe2GngW1Nbw== X-Google-Smtp-Source: AGHT+IETSyzFH0Bz6Ec2Mnvs5wVy4/xTQ5iOxwAd2NvqnI/vlBsybetK+XQslDRBoXifDH3+R/pY X-Received: by 2002:a17:902:e543:b0:1e2:538:a063 with SMTP id n3-20020a170902e54300b001e20538a063mr16618151plf.33.1712066755203; Tue, 02 Apr 2024 07:05:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712066755; cv=pass; d=google.com; s=arc-20160816; b=Ra4iPTg8NPuN2dgN48h/OMF6PSvuXs3YqL/ddNcOldsIZplwe0FvFnz33ZGKYaD1Gi W9XidomdgMklj2Xm7JFlzKJcaxRcOcXJWMDDMg4YBUtwSYGVG20G1s5nhiBZKnWnoxHg zNzZ7fTcEzkxNGP2FtTx88lJKFUY4mQu2wh/ALI/Tc3b3HMAyPnAbJXXG8PnwMe7auvR HKJsUE3kORV81JAP25zqEkx1SPK1Mw6VOCU7Z1sYtKeMYrqvOKM0jFeAajtgxdXDrC3F IB6TFJS4qhULSMRYTCCpOD/b1j7KMGC4omdbA9jUZQr/oswD4xja6xh0oO9vBDS9f3V2 hY2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=GTjl1nh440a+DglsfE5+x1ZIRvYKsGb3C02MGXgaUA0=; fh=/3YkoB4fDlBNT7qHZTQxElefuuzmCA7DH5AbDYBX874=; b=sCAvnseYGE8Py6Ta3l63gBTd6h67t7SBe9XdGCE7WEx1wwmYO8Seh4W2l7V4IKpmiE Sw1V9XtQWh6oXeOvwZ1j2vjGjtqK3UAyt5RGg1W5WhRGBOEk7RH8cpb6aia2H2gZwHBe ojQiGFgw0PsAjoygUiNIQ0AMtUdRlby+pC5zRZgXIiV016X4XnbRS8PKlTlVLYYwTb8v h0SJ5vlBEw/3SLXcY7agcFa9R1SMPhxpig5GSU/65qfTIWhAB2jIMT1/Kkd4AbBCDQUY D6+d2xLnIMJVkQXvaGcPMsxXwg0aygA9DHt9Kf5mg7PiIiZ0PHOfePELVMLZSalRxa/G jvew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YqV1LlzV; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-128053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l1-20020a170902d04100b001d6f89cfec9si1079200pll.348.2024.04.02.07.05.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YqV1LlzV; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-128053-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E9410B2AC59 for ; Tue, 2 Apr 2024 13:31:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0494983CD8; Tue, 2 Apr 2024 13:31:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YqV1LlzV" 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 6667B60B96 for ; Tue, 2 Apr 2024 13:31:23 +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=1712064685; cv=none; b=HLrtll9mxuYxuQZUw22lWiaxmaw7P8peeI3U3FfjXRAh4JXVYbqj2Y0j3vDZwOYofBN3GWwP+0DsCH/yC7MCIyYsMJrQF6//aGaAcVIf9CJntHppMqk5lQvuzRJIjEsrgiSk12uVuVLDPsY6JbBRXMuSVwo8vUZxCxgOIrHGrNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712064685; c=relaxed/simple; bh=kcQoxH0jxIgJ/P84Xua+U3nNWiWfpKTH/xOh3LWBl1c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K6ELwohSw518qOlic5LUqdMzL9NVrJuiinjprR/k3OdNlcKZeG2k1CNu8sgtYE+twbgUMWJ+PdVygweOVb5uInnj/31brK55VrLLVO2eX7xi375/aeVuh2GX0fGIHIBU4u66g/+1Gbbm1xpQNv0ld7ozxS+ifqdEIH5EbKzOm+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=YqV1LlzV; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712064682; 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=GTjl1nh440a+DglsfE5+x1ZIRvYKsGb3C02MGXgaUA0=; b=YqV1LlzVCqqIAnvEOTQejbRKXyQWGwuGKVrU5HMRmrx5YEQvCcikp/GzJ4VruP0bDk2wla 4s9HXAIVOWjiZvkt1hw5Zis4oAZKreoheI8mEQsKw3DlPEvtw77gDrLU4EINh4lMc1iooD l4MZhLmwr4EFIQKcYh5JOp2w8jabMoc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-L19wE6C2MtyeSXI-n9B4Mw-1; Tue, 02 Apr 2024 09:31:20 -0400 X-MC-Unique: L19wE6C2MtyeSXI-n9B4Mw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6CB0A1C0AF45; Tue, 2 Apr 2024 13:31:17 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB0811C060D6; Tue, 2 Apr 2024 13:31:14 +0000 (UTC) Date: Tue, 2 Apr 2024 08:31:09 -0500 From: Eric Blake To: Christoph Hellwig Cc: Stefan Hajnoczi , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Alasdair Kergon , Mikulas Patocka , dm-devel@lists.linux.dev, David Teigland , Mike Snitzer , Jens Axboe , Joe Thornber Subject: Re: [RFC 0/9] block: add llseek(SEEK_HOLE/SEEK_DATA) support Message-ID: <6yjbfcrsmdmibrfs2pcseehrcbjkn67qzanyhlrduocguqvoaq@jjwntpqtsmpc> References: <20240328203910.2370087-1-stefanha@redhat.com> <20240402122617.GA30720@lst.de> 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: <20240402122617.GA30720@lst.de> User-Agent: NeoMutt/20240201 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 On Tue, Apr 02, 2024 at 02:26:17PM +0200, Christoph Hellwig wrote: > On Thu, Mar 28, 2024 at 04:39:01PM -0400, Stefan Hajnoczi wrote: > > In the block device world there are similar concepts to holes: > > - SCSI has Logical Block Provisioning where the "mapped" state would be > > considered data and other states would be considered holes. > > But for SCSI (and ATA and NVMe) unmapped/delallocated/etc blocks do > not have to return zeroes. They could also return some other > initialization pattern pattern. So they are (unfortunately) not a 1:1 > mapping to holes in sparse files. Yes, and Stefan already answered that: https://lore.kernel.org/dm-devel/e2lcp3n5gpf7zmlpyn4nj7wsr36sffn23z5bmzlsghu6oapi5u@sdkcbpimi5is/t/#m58146a45951ec086966497e179a2b2715692712d >> SCSI initiators can check the Logical Block Provisioning Read Zeroes >> (LBPRZ) field to determine whether or not zeroes are guaranteed. The sd >> driver would only rely on the device when LPBRZ indicates that zeroes >> will be read. Otherwise the driver would report that the device is >> filled with data. As well as my question on whether the community would be open to introducing new SEEK_* constants to allow orthogonality between searching for zeroes (known to read as zero, whether or not it was allocated) vs. sparseness (known to be unallocated, whether or not it reads as zero), where the existing SEEK_HOLE seeks for both properties at once. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org