From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 28FFB3857B93 for ; Mon, 21 Aug 2023 04:33:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 28FFB3857B93 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5236b2b4cdbso3611211a12.3 for ; Sun, 20 Aug 2023 21:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692592398; x=1693197198; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=i+pVLdyofjfiA7eUavmrg7V7cHnkc2AJextI8dJJgB4=; b=ONyucjbCqikzVMUJbSTtc3Ydq149W5H54TLPnSkwWd6zUHn8Q+r4xdd7ZEA995Yrws TB2BGnJUKkjJqaimPZVXgxou/u690Yn8DEq6GEQdC1AJM9VFu6TBYlNQygkkcrU+EFqo EnJtDhgqDHEzLbZEiAaG46ZSjVOLzzpdDBp5Sz4tPt//SdGpQJYd8s4S/FotJ5hsfSQ1 Sb4hDTEABGWeyqREKZnb8Qel8tl6DBSb9fscNDHBUYk8/nXLw59S8tahL4+3mBmxBg6o rvL77lgGhsLv+jxsXCyDfEs9MT2KQs3C/vFSARtsJg41t/3QGdXsn9C4LklL4ZO4vfMQ 0S/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692592398; x=1693197198; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=i+pVLdyofjfiA7eUavmrg7V7cHnkc2AJextI8dJJgB4=; b=P3NAODoTDJ6TkCeWkr0alWA6Pkufbi2+Ya2klZqrG6cL5ytZyDnE7090n8EmpdKsJ3 mZv9ct3ALwkM1hJhrnRoUb9cept4KBb1AGFFpyX6H0DhjLx7O9lAhKlLi5vpG4e5uojj xMF3KMmNtLpSccfcl8rJ1yfqLOFiaYeFZxyrWk2tLaZiOcGwENzO+j+IlKGO2sTN0H6V ns6oes0aGl+QLc4mDAOMRPFiKPl/007wKS2YHT75beFTib9qGc8jebsAa2jkthRNXJTR L8lLxZ+R2jFQOyppMDheqelDhGZhr+h/LTMkby7A1xd3MvKSEP3vPAO5IIeyQhaULF8o 1rKQ== X-Gm-Message-State: AOJu0Yw0GIXMPQL8WS1sfZ+qqzB8kpJeKpTKvWd++/yOMndDc8WnNjS2 yd8Oa644Woa+st8SbxMr1GdhYz4YLB1lm7HLW4hMnc07yPDpMw== X-Google-Smtp-Source: AGHT+IEstlXYSk/5Rl6WSPa16ZGfG+sHg4DyWxS/AfcuZhUBha13LdD3gMVxSCZXc0dkWbwIO0NHSt6Hl4aoGgtlcyA= X-Received: by 2002:a05:6402:545:b0:523:1400:2d7c with SMTP id i5-20020a056402054500b0052314002d7cmr3381262edx.35.1692592398211; Sun, 20 Aug 2023 21:33:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Cedric Blancher Date: Mon, 21 Aug 2023 06:33:00 +0200 Message-ID: Subject: Re: SEEK_HOLE Support in Cygwin? To: cygwin-developers@cygwin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 10 Aug 2023 at 10:28, Corinna Vinschen wrote: > > On Aug 10 04:43, Cedric Blancher wrote: > > On Wed, 9 Aug 2023 at 17:30, Corinna Vinschen wrote: > > > > > > On Aug 7 10:33, Corinna Vinschen wrote: > > > > Wrong mailing list, use cygwin AT cygwin DOT com for user questions. > > > > > > > > On Aug 6 19:14, Cedric Blancher wrote: > > > > > Good evening! > > > > > > > > > > Are there plans for a SEEK_HOLE support to Cygwin, e.g. on top of the > > > > > FSCTL_QUERY_ALLOCATED_RANGES api (if appropriate)? > > > > > > > > No plans, but patches are welcome. This looks like a fun task for a > > > > rainy weekend. > > > > > > Today was a really rainy day and I had to wait for a test system to > > > come up, so I hacked on SEEK_DATA/SEEK_HOLE support. > > > > > > Check out the next Cygwin test release 3.5.0-0.384.g9939aa7d0945. > > > > Thank you! > > Or should I thank the weather gods? ;) > > > > How can I download this version? > > Cygwin setup, as usual. Just install the above version of the packages > cygwin and cygwin-devel. Corinna, Thank you! > > > > Note that this defaults to the default behaviour described in the > > > Linux man page, see https://man7.org/linux/man-pages/man2/lseek.2.html > > > > > > I.e., "In the simplest implementation, a filesystem can support the > > > operations by making SEEK_HOLE always return the offset of the end of > > > the file, and making SEEK_DATA always return offset" > > > > So this supports multiple holes in one file, right? > > Curious question. Cygwin supports sparse files for ages. Only the > lseek options SEEK_HOLE and SEEK_DATA are new. Is SEEK_HOLE support enabled for MSFT NFSv3 client? > > But, yes, it supports what Windows supports. But note that Cygwin > *only* switches files to sparse, if you seek by more than 128K beyond > current EOF and then wrote something, or if you call truncate/ftruncate, > raising the filesize by more than 128K. Where does the value of 128K come from? Is this a Windows limit, kernel tunable, or something from Cygwin? > > In contrast to Linux, one has to sparsify a file explicitely on WIndows, > and that's Cygwin's strategy. Maybe add a O_SPARSEFILE to open/openat()? > > > > The real deal obviously requires a filesystem supporting sparse files, > > > *and* it requires that you access the file via a mount point with the > > > "sparse" option set! The mount option "sparse" is not set by default. > > > > Why is "sparse" not the default mount option? > > It was, at one point long ago. People complained that sparse file > access is slower than standard file access, so the "sparse" mount option > was added. Do you have any refs in the mailing list? Ced