From owner-freebsd-fs@freebsd.org Thu Jun 4 16:48:55 2020 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF1313297BA for ; Thu, 4 Jun 2020 16:48:55 +0000 (UTC) (envelope-from goatshit54108@national.shitposting.agency) Received: from mail.cock.li (mail.cock.li [37.120.193.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49dBYx1z2dz4GwK for ; Thu, 4 Jun 2020 16:48:52 +0000 (UTC) (envelope-from goatshit54108@national.shitposting.agency) To: freebsd-fs@freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=national.shitposting.agency; s=mail; t=1591288754; bh=SkkQuYujo0QFwcH1V0Ok2sgMgP3dt8baIe+XZ15IGbg=; h=To:From:Subject:Date:From; b=nsjBhyxNIfL2uXk+P8b8C+Zt/Ol9qPKTDZ0KjTJdpopXtpGOPAIsIpSG0KJtqbVA+ vvmcfsiq/K5VK71s4jRYL4bK/3pKzAOSvrHgkFhLcX/Kp7W3L0tNDSx0mhD/egxBc2 xsNtpoltbYBLw6gSxhFQfBEYCjuvxH37Q4S1+zuTeODzo1lhdVG+pjpqRC0Ezh+Gw8 WVLMZNh7POzqHoo7mvD5cbCqfXHCNfCf940hWGrzTDBEmEbdbvuB7DVUZcaVPvDhWc KiVIQCCzSFX4JI9dtzhwnfHXzKHAaCuS0iE5E22VkdQsKwnzxbWn4Nzercy2zQfNI0 SUyBg/5/rHxOA== From: goatshit54108@national.shitposting.agency Subject: newfs(1) on a file Message-ID: <1d05302e-db7f-2538-16ee-dcd73c229e37@national.shitposting.agency> Date: Thu, 4 Jun 2020 16:39:03 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49dBYx1z2dz4GwK X-Spamd-Bar: +++++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=national.shitposting.agency header.s=mail header.b=nsjBhyxN; dmarc=none; spf=fail (mx1.freebsd.org: domain of goatshit54108@national.shitposting.agency does not designate 37.120.193.124 as permitted sender) smtp.mailfrom=goatshit54108@national.shitposting.agency X-Spamd-Result: default: False [11.61 / 15.00]; ARC_NA(0.00)[]; R_SPF_FAIL(1.00)[-all]; R_DKIM_ALLOW(0.00)[national.shitposting.agency:s=mail]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.63)[0.631]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[shitposting.agency]; NEURAL_SPAM_MEDIUM(0.99)[0.993]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; VIOLATED_DIRECT_SPF(3.50)[]; DKIM_TRACE(0.00)[national.shitposting.agency:+]; NEURAL_SPAM_LONG(0.98)[0.984]; FROM_NO_DN(0.00)[]; FORGED_MUA_MOZILLA_MAIL_MSGID_UNKNOWN(2.50)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; RBL_SENDERSCORE(2.00)[37.120.193.124:from]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:9009, ipnet:37.120.193.0/24, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; GREYLIST(0.00)[pass,body] X-Spam: Yes X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2020 16:48:57 -0000 Running newfs(1) on a regular file bumps into some GAY issues: $ dd status=none if=/dev/zero bs=1m count=4 of=shit $ newfs ./shit newfs: ./shit: not a character-special device: No error: 0 newfs: no valid label found The message is not clear, but it happens to be a cry for a BSD label. OK, first creating a BSD label does allow newfs to succeed: $ bsdlabel -wf ./shit $ newfs ./shit newfs: ./shit: not a character-special device: No error: 0 ... (creation OK) The bump is inside getdisklabel(). Patching out the one and only call to getdisklabel() seems to avoid the issue without negative consequences: ... lp = NULL; //lp = getdisklabel(); // GAY ... $ dd status=none if=/dev/zero bs=1m count=4 of=shit $ non-gay_newfs ./shit newfs: ./shit: not a character-special device: No error: 0 preposterous size 0 $ non-gay_newfs -s $(((4 << 20) / 512)) ./shit newfs: ./shit: not a character-special device: No error: 0 ... (creation OK) The inconvenient alternative, to get newfs to format the file though a memory disk, appears to create an identical file: $ dd status=none if=/dev/zero bs=1m count=4 of=shit $ su root ... (GAY) ... # mdconfig -a -t vnode -f ./shit -u 9 # newfs /dev/md9 ... (creation OK) ... Identical, that is, if we use `newfs -R` and discount a couple of reproducibility bugs/issues (, ). Also, at a glance, using the BSD label method yields nothing other than a UFS filesystem along with a BSD label. So this code appears to be old garbage. Furthermore, the "not a character-special device" warning is just GAY without any benefit. Or?...