Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2062170lqz; Tue, 2 Apr 2024 06:21:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvGdM3xSms3O32tj+GiBhQ8mvg/3vDoNtaEw4mu6GDtySU+Mxn3dTA+rUJS8v9GNM22f0QiULvmjklqxzK1iTjIiahOznnFHQVE5N12A== X-Google-Smtp-Source: AGHT+IHQkBz1kU5uR4nHLWpy33xZ6bjXxkF42ZD+Ntat3c7qKogjlnl9T+kFji9YoT+PqwGa//G2 X-Received: by 2002:a17:902:ce8c:b0:1e0:bc7e:6fba with SMTP id f12-20020a170902ce8c00b001e0bc7e6fbamr15324341plg.5.1712064113887; Tue, 02 Apr 2024 06:21:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712064113; cv=pass; d=google.com; s=arc-20160816; b=Vj2/jPKF8xTLLCHkiOGM+WZVfs4kpObGWUTHGmvclB4+EQngGqkIQXaXeqSFkirhi+ cPqXz93b6SMB1ePhKaTURHmA7xguj3+usF9Rwn5RbfFGwrjfcQIySPeBrzqJ6G1S353Q td2JWCa32h1JyR7eFgptfP2DbfqNmi9XKg9+ciUEh5a9PoY34hVb3fLxW8/WhlDo5ike 9RxI7GjBUasI89iPinuqxfjamPh2GQGXn4sU/Ynx8ZXKmPSnzyxrLKVHRIab2NFJefub nqp8KreNNB7ix6ncN6xhA1tT1jjBnYrm7rZ3Sw+q2X7JHfu6eAuFCPTyLXXJZDjtynfs corQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=OvSWXFalEF6OU22DUvBZWFYn2B7uDOAlKG6m5QBQYIk=; fh=E4uzpIKgbJBYOGkzOeMeXZ1iT1I7/yNzqjWeirliKPo=; b=hqSH0zEnJ54k8esSx3W4Z805cNJY7VyRxCb5n2kUtpEg1eK7t7tNwV2P8BB1VhQrZo do9zo9UeFJAgcDtjRkwc0g3wLCqcrEwqnHdGnuCllyQ24dysGj06LHBxfKSai6Gff1UW UUVIxPcVvuOh/USoowHpu7yTEVoa1JJpVxjECqBL1rQcAodUI3QVotgPegThX9Mq1FWX lZx/xd3ADDhq7gcKypKvKVsF+4NV3DO9zsNtGv8J7PTHVKOdVQiaRz6Bm8LL5YCwmeNW oyE6BkuzvQoDVmodoiRPDwLyQpSXT4ZsEJ7zgyAo0iVujgnHFbrF/K/9SNUupeIBEkC8 JH/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OyEtQoag; 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-127993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127993-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id lk3-20020a17090308c300b001defa2d6abasi11297506plb.71.2024.04.02.06.21.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:21:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OyEtQoag; 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-127993-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127993-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 75297B24A46 for ; Tue, 2 Apr 2024 13:05:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2883E7F7E2; Tue, 2 Apr 2024 13:05:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OyEtQoag" 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 E38397F7D9 for ; Tue, 2 Apr 2024 13:04:59 +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=1712063101; cv=none; b=GFR7CyET5RvKDiG8kE/qc7iiZDCFxhqz6INsH1CNy5jpkLh+5ruwqjNkh7a7/L84cj+iS4DpzTA8U09Mjd5U7gQ6GCmQpUoYahXb2ki6u57k86rpyCIah3MUKr56HRPKyieCUbsV3YjmUH+uPjly1w7w1m8MUZ6CQgo7B0Of+vM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712063101; c=relaxed/simple; bh=7ah2VuBYWEmWHWPyFP68b6yoTO91npOyV7LilgwLJqw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hzcdEtVCIG6KB+jhsVWM5UkTouKscbZSR9uaYCi4YsFyBVAtbDmaJbuHbd8919YaT3GPHPUEixmSrOmxiZSw4zfmSazX+GcCfZUzNeTBx3lJDcBxUtlNWItCEHf4FV5UiZf9BOvmnABbaK3k40QiTD7XcmOhrpedXPnpsESxFSw= 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=OyEtQoag; arc=none smtp.client-ip=170.10.133.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=1712063099; 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=OvSWXFalEF6OU22DUvBZWFYn2B7uDOAlKG6m5QBQYIk=; b=OyEtQoagPD+Aa6qqMsnaUEvqFJkXtHGgW6YIBGtAPBhZJfx23fBBAmP+REZ3QMrv7bY8e/ QoPDZ6pjq9lxLlG6DfzEQsCE5mALlkrWHFO92+0jPptq1tivgKDCi20NOpjhlZLgNhlEO6 BRXctDsSSu42sdEa5TwAjO2YV3HP3RI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-NI3dA4XqNgaoiilj5Na5TA-1; Tue, 02 Apr 2024 09:04:54 -0400 X-MC-Unique: NI3dA4XqNgaoiilj5Na5TA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 141C3101A520; Tue, 2 Apr 2024 13:04:54 +0000 (UTC) Received: from localhost (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2134E492BCD; Tue, 2 Apr 2024 13:04:52 +0000 (UTC) Date: Tue, 2 Apr 2024 09:04:46 -0400 From: Stefan Hajnoczi To: Christoph Hellwig Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, eblake@redhat.com, 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: <20240402130446.GA2496428@fedora> 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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RDsvgnmIpxDRfcPA" Content-Disposition: inline In-Reply-To: <20240402122617.GA30720@lst.de> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 --RDsvgnmIpxDRfcPA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. Hi Christoph, There is a 1:1 mapping when when the Logical Block Provisioning Read Zeroes (LBPRZ) field is set to xx1b in the Logical Block Provisioning VPD page. Otherwise SEEK_HOLE/SEEK_DATA has to treat the device as filled with data because it doesn't know where the holes are. Stefan --RDsvgnmIpxDRfcPA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmYMAm4ACgkQnKSrs4Gr c8hVxQf6Ai3HCf81vk9Zfg0wnaREk8TJeBtQghYd36C8nr5bX1BpwXAQog0wnYbZ VK0zB5aL/xDtzp+Vs69+Dn7ouGRxk48H5h1Xk8o9UD2XWSoS4f+bb7b5nSKeF45y gQd/tdgI+ch4AqbpByYz6Cgc3ZqJ03Tcm+zm9Vj4xUiXw1Hhj1V/09vVzif9X5tw 3/80Yd4JLU1W/7cznhTTAIrpz8L+NAclZkQFVtfbvV0aXQfAXGvV8Kl82ddmKBmL +ovnir/EbVpxUcg4veYJCme1B8D6ALU4znM2krhnz6g5jBynLN+av88weJErNfox 34X6JufpJpSZUzfyTIA6PB7z5eS3Lg== =cwzD -----END PGP SIGNATURE----- --RDsvgnmIpxDRfcPA--