DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 535EveOT366746 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 535EveOT366746 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=Tp1Wb3H4 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DA9B3857737 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1743865058; bh=L/gLI4IFy+VEsi2OB5TtQrr9ExGxMHNOiHpUoskZyd4=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Tp1Wb3H4Od0696nLnpT3IFzEmNn6HSXvjrw74rPfmCNb9Hlau1cH6HQL0htl5MuKv cshAp1RajYQs3ipmEDdERqrYzWsKSjF3W9RK8gxUrMHGOYXnkoSj2pvSDVAKJnKFTA p4dPryAG1YDhRr807jl4XxcDei20dUXXxDHzjS60= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3401F3858408 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3401F3858408 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1743864999; cv=pass; b=d0PR5TQuQ9KoxyaAj6eh1TpEYs2hvzdh4LR1tPKNdHtE4o8DwRMbnhY3FVR8emUtrW5P1rebIk7Xzadt6phxEbYU3OWK3PQA8aguq2NV/inHA0f9CUIy9RG1DZR5Ha8VjKEMPF0jtgFz/ZHtGLOEZHXRs7i/QOKfykO8tH4Jx64= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1743864999; c=relaxed/simple; bh=EgjQLVYIob+UfG8ERAQph52CtsiHc9sQpl9QJaIAH10=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=S5zu3uDUPASO89nAsyg5hnrf3QP7F+Nr5UejReSB6BPtSHMEIDJZwamdPRa6/5XErSF/kOg16USuSa/JEEMgPWRoAFdmHbYuYEAt0h+uklMb/eVf+LxYSPFegNvdQJSaIg3xx3noMhxmcrUF9D7OVxWUsPNpT1pOjuRQxlvMZqQ= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3401F3858408 X-Sender-Id: dreamhost|x-authsender|gisburn AT nrubsig DOT org ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1743864997; a=rsa-sha256; cv=none; b=eIMfkQ4btxPu6OI5VlZErJZ3Rl7rr4+FmLrJL8xb6xClT0d/t+k9MR85MRmRTEAHuzrEyL tAPC4rdCw+M331IMB/1HAQlQSPPaX89iQjTkH/HG8f21OZ5jim1uJOpAV1Cs/nowjJC6b2 tka4eJVWvFYaXjAGvBTY54fnshWe5jka0oZHZJ83fiz2RRIGyvADiDHE7lq7bqXOTUFKxo m53/KnnVUETmg/kgbagbq4sgkaBt+DLBaBtObu71LUjw/rKLdHeEjlA3trQKTMBmEalM9p MOFJk1mHh6ufRkfWcoSTue37TUqOSuzdV3GJPrHTUJno7PV4dk63ZJIkuUi+/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1743864997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Iqxbuq4oNamG0/mRJTWFD6aMKvKCzbXCOWxn1O/1ssc=; b=C8xDVMlW9Cz/yYikeOnW/eUIqyhqHcVhMaHONl5xeyhVRHKbbq8XZ6lMfmVdqkmiupWbpQ eThH4+N1JxK3avR8FvwZOMLu+GBt3vRS12IfYM+CQttbeh6aDAcYc9oFYw4V9fCMKf7nL0 fL3Byfo+KJs2GyWPeTCRtBxXKDK16JyYp7H1BrjaZwayrEZbGsBlUZAtyVOF9r0XfcIsO2 fFBelf9yyy8HI5cDETQKeUesuhpX8DPlB+GMC/JT5Wmck+lg/n5scSKuC1nPBJlq/rQcZZ zFj5X9RgpoBeoMEJfrqWsLA5JFh5OuwM/j+w65jICDTvaO8EIiucuI0WFqd+1w== ARC-Authentication-Results: i=1; rspamd-6c88b8f79f-w6fs4; auth=pass smtp.auth=dreamhost smtp.mailfrom=roland DOT mainz AT nrubsig DOT org X-Sender-Id: dreamhost|x-authsender|gisburn AT nrubsig DOT org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|gisburn AT nrubsig DOT org X-MailChannels-Auth-Id: dreamhost X-Keen-Relation: 5c235ac744f512a1_1743864997810_2260407617 X-MC-Loop-Signature: 1743864997810:195968753 X-MC-Ingress-Time: 1743864997810 X-Gm-Message-State: AOJu0YyjNI6W0J30ttcsB8pdC64WeOIUvlZ+j5s0dYyOXTn7HGls0OHy rstErnqNDDrS1e+VMj1Y/S5ovVZrkQg/FdHC5xLYgZ1G9/SpgDCFo/ZEBKUQjOn6VfzbcFpF5uI 0rU/3Zc/gbA2cL3XM/WwMc4oNyTs= X-Google-Smtp-Source: AGHT+IF85TJl3Tkshw5JT9KIrfUKYLBreD0YbOG6D7KJtcSvCJw4tb594Adeo2Jof36B+kLXw5pOxVCv+mMi6+PeNZ8= X-Received: by 2002:a5d:5f83:0:b0:391:319c:1950 with SMTP id ffacd0b85a97d-39d07ad8a86mr5014821f8f.8.1743864995399; Sat, 05 Apr 2025 07:56:35 -0700 (PDT) MIME-Version: 1.0 References: <5e2eb205-c863-7575-628e-74a968b90a7c AT t-online DOT de> In-Reply-To: <5e2eb205-c863-7575-628e-74a968b90a7c@t-online.de> Date: Sat, 5 Apr 2025 16:56:09 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: ATxdqUG6yyLJNdB449GBx8iKHM3dSkcbLVPNRsPrJhFOBW0zrI5yAOxgmYQYxyo Message-ID: Subject: Re: cygutils 1.4.17-2: lssparse -H does not print hole at offset 0 if more data exists To: cygwin AT cygwin DOT com, ms-nfs41-client-devel AT lists DOT sourceforge DOT net X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Roland Mainz via Cygwin Reply-To: Roland Mainz Content-Type: text/plain; charset="utf-8" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 535EveOT366746 On Wed, Apr 2, 2025 at 4:01 PM Christian Franke via Cygwin wrote: > > Testcase for a minor issue: > > $ > sparse_file > > $ chattr +S sparse_file > > $ dd if=/dev/zero bs=1M count=1 conv=sparse,notrunc of=sparse_file > ... > $ lssparse sparse_file # OK > > $ lssparse -H sparse_file # OK > Hole range[0]: offset=0x0, length=0x100000 > > $ printf X >> sparse_file > > $ lssparse sparse_file # OK > Data range[1]: offset=0x100000, length=0x1 > > $ lssparse -H sparse_file # Missing 'Hole range[0]' > Data range[1]: offset=0x100000, length=0x1 > > The condition at lssparse.c:161 is never true: > > 141 for (i=1 ;;) { > ... > 161 if (print_holes && (i == 0) && (data_start > 0)) { > > Possible patch attached. Important: Not tested with other corner cases. 1. *Thanks* ... :-) 2. New version is available from http://svn.nrubsig.org/svn/people/gisburn/code/sparsefiles/lssparse.c 3. I did these two changes (GoogleMail might ruin the whitespaces, please use http://svn.nrubsig.org/svn/people/gisburn/code/sparsefiles/lssparse.c for the original version): -------- snip -------- From ed7f138e1682b7da95d606125b81abf754653a0f Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Sat, 5 Apr 2025 16:43:13 +0200 Subject: [PATCH 1/2] lssparse -H does not print hole at offset 0 if more data exists lssparse -H does not print hole at offset 0 if more data exists. Fixes: https://cygwin.com/pipermail/cygwin/2025-April/257843.html Reported-by: Christian Franke --- lssparse.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) index 4adb200..6fc269e 100644 --- a/lssparse.c +++ b/lssparse.c @@ -2,7 +2,7 @@ /* * MIT License * - * Copyright (c) 2011-2012 Roland Mainz + * Copyright (c) 2011-2025 Roland Mainz * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -139,7 +139,8 @@ int main(int argc, char *argv[]) * $ /cygdrive/c/Windows/system32/fsutil sparse queryrange ... # * output */ - for (i=1 ;;) { +#define LSSPARSE_START_INDEX 1 + for (i=LSSPARSE_START_INDEX ;;) { data_start = lseek(fd, offset, SEEK_DATA); if (data_start == -1) break; @@ -159,7 +160,8 @@ int main(int argc, char *argv[]) } } - if (print_holes && (i == 0) && (data_start > 0)) { + if (print_holes && + (i == LSSPARSE_START_INDEX) && (data_start > 0)) { (void)printf((pb == pb_hex)? "Hole range[%ld]: offset=0x%llx,\tlength=0x%llx\n": "Hole range[%ld]: offset=%lld,\tlength=%lld\n", @@ -215,7 +217,7 @@ int main(int argc, char *argv[]) (void)printf((pb == pb_hex)? "Hole range[%ld]: offset=0x%llx,\tlength=0x%llx\n": "Hole range[%ld]: offset=%lld,\tlength=%lld\n", - (long)0, + (long)LSSPARSE_START_INDEX, (long long)0LL, (long long)file_size); } -- 2.45.1 From 1b23534234fa58633bc96137220a9b9b32d4aa5f Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Sat, 5 Apr 2025 16:48:36 +0200 Subject: [PATCH 2/2] lssparse usage message should print all options in short form line lssparse usage message should print all options in short form line. --- lssparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) index 6fc269e..399ac75 100644 --- a/lssparse.c +++ b/lssparse.c @@ -42,7 +42,7 @@ static void usage(const char *progname) { - (void)fprintf(stderr, "Usage: %s [-h] \n" + (void)fprintf(stderr, "Usage: %s [-h] [-xdH] \n" " -h: Display this help message\n" " -x: Print offsets in hexadecimal (base 16)\n" " -d: Print offsets in decimal (base 10)\n" -------- snip -------- ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland DOT mainz AT nrubsig DOT org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple