From nobody Fri Feb 25 16:28:29 2022 X-Original-To: stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 86E5019D8913 for ; Fri, 25 Feb 2022 16:28:38 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:300:2185:123::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4K4wFK5NM8z4ggD for ; Fri, 25 Feb 2022 16:28:37 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [104.207.135.49]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id 21PGSUsL055161; Fri, 25 Feb 2022 16:28:30 GMT (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id 21PGSTfW055152; Fri, 25 Feb 2022 16:28:29 GMT (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <202202251628.21PGSTfW055152@donotpassgo.dyslexicfish.net> Date: Fri, 25 Feb 2022 16:28:29 +0000 Organization: Dyslexic Fish To: ronald-lists@klop.ws, pete@twisted.org.uk Cc: stable@FreeBSD.org, ctuffli@gmail.com Subject: Re: Instance drives in AWS comming up with the wrong size References: <82956746-91aa-4744-c12f-40c5ff7c3f39@twisted.org.uk> <911165478.11.1645798384085@mailrelay> In-Reply-To: <911165478.11.1645798384085@mailrelay> User-Agent: Heirloom mailx 12.4 7/29/08 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [104.207.135.49]); Fri, 25 Feb 2022 16:28:30 +0000 (GMT) X-Rspamd-Queue-Id: 4K4wFK5NM8z4ggD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=catflap.org; spf=pass (mx1.freebsd.org: domain of jamie@catflap.org designates 2001:19f0:300:2185:123::1 as permitted sender) smtp.mailfrom=jamie@catflap.org X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jamie]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx:dyslexicfish.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[catflap.org,none]; MLMMJ_DEST(0.00)[stable]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:20473, ipnet:2001:19f0::/38, country:US]; FREEMAIL_CC(0.00)[FreeBSD.org,gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Ronald Klop wrote: > Wow, > > diskinfo.c has explicit support for regular files: > > But I would not know the proper use case for that related to the name of the tool. I guess reading an imagefile, without needed to make an md device of it first, I guess.... But hardly a "must have", in my opinion. Howerver, what's even worse is that it first looks for in the current directory, and if that fails, it then tries /dev/ And to compound that, the screen output doesn't show whether it's matching ./ or /dev/ leading easily to the confusion Pete encountered. I think it should either treat the provided as an unaltered filepath (i.e. "xxx" refers to file "./xxx", "/dev/xxx" refers to file "/dev/xxx" etc.) OR have it anchored to /dev unless a path is specified (i.e. "xxx" refers to "/dev/xxx", "./xxx" refers to "./xxx", "/tmp/xxx" refers to "/tmp/xxx" etc.) but the current ambiguous method is the worst of both worlds. Still, at the very least, the file being accessed should be unambiguously displayed in the output. | jamie@thompson% pwd | /tmp | | jamie@thompson% dd if=/dev/ada0 bs=1m count=10 of=ada1 | 10+0 records in | 10+0 records out | 10485760 bytes transferred in 0.036465 secs (287554872 bytes/sec) | | jamie@thompson% diskinfo ada1 | ada1 512 10485760 20480 4096 0 | | jamie@thompson% rm ada1 | | jamie@thompson% diskinfo ada1 | ada1 512 1050214588416 2051200368 0 0 2034921 16 63 NASTY! Cheers, Jamie