From nobody Mon Nov 24 16:03:06 2025 X-Original-To: hackers@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 4dFVwm3NXnz6HR2d for ; Mon, 24 Nov 2025 16:03:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dFVwm0m2Jz3tsj for ; Mon, 24 Nov 2025 16:03:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-3436d6ca17bso4500012a91.3 for ; Mon, 24 Nov 2025 08:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1764000197; x=1764604997; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UtjHOIB689CgBftwVjkBbRQQIpXHUTP7HTNgVHrkMLs=; b=wNv1Hh0tvqEZKmGcjLXOatRJpII62COs4bDnlESd3Capn+TYseebi7U1LfDQHwrQur vpHFsu+r/VKGpkfKHmLgwjjFfRxEA/7sa9TOkYjx597JP/Dj6Cl8Fp4LUWHQ5TPutM7w NresgdtlmGnpM9JRvXnj52FkC3iT92w1BkzB6BAKWk83308+5+GNcss5CwDoLQJetEHJ K7RS1UZnBQSmu3mbZ3KM2yqFNQx+kmzTbqdVoDF4fe31DCUFV45qeS6Y+EsrfBc+6eMk bsJIeU2q4KumVPsVYHabizao92ayG4FFX+GQddBHI2Rr0QmG5BfHUpy8xgFwpWvtHm1D 5H3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764000197; x=1764604997; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UtjHOIB689CgBftwVjkBbRQQIpXHUTP7HTNgVHrkMLs=; b=Q2o4y2ra2xAf0bDARBy1RiC8T+0JUHxsklaBVdj+6GZbLaDvxsotDzpXVgIgco9xEF u1IoUKRrTFlKsawS8UIy7YxgHeWfEOE/FjVO1VcSY1+Z0CF3KcIHko40V6f0+J2zrGsN /0ycrKPTGmlEkD5JEVVcU5rRK7VFRWMXBTBMONhJWZJJbdDikSr/qmIJcu1wobigc5NK BlsTqGG4do8M5WYPXt2lLBnTjWSO4JYsfJY2wacMXC4pTeJIXvz6iT3AQNOBTaKfZ7Wz /TWWM1rrlWaR7YMAsHpB1Ckj/H6PZlbPZi1RprulQkIOyyWrqf8CP9inypFIDREKGt2Q d7iw== X-Gm-Message-State: AOJu0Yx2OILNoL6ONFmqnpg1esqgXfFk/vvOZ2dkMM9SZFvJOmr9szE5 iUTA7vZ1a0qdPTluDws+eh1NIDN5Riv6vV115DbRWM4OG0GTwLLGu1RWCEozCP34EYhDMyzzYaM WbctJrJzR9P18oXWNDkJ1rEECJATGS+ufaW8rDAhexA== X-Gm-Gg: ASbGncuIuRc+tKHT8CQyeSVcmvfvpea/DS6knPtUdyBjZADaT1VEPXG9BgXB9ARKaT6 41FwH432pOhUr3/dvUPjb5PxiGda2mB1Tmh+It3WXVzo18qCewONMSbS+lBh85nR6DDtDrvEnQJ JyWfJD1/xSYhZE3kWOWjEdCwusw8Wav1+1SpshcKnxx58RZaURlHEZl8vt0QvqCc84rxk+wBbTC IpyxqUWU5ISQdj4VLErU/srnvkyjtOu3sCOparolChokHkoyqqVU953l1hpedIt1G6+6Mk= X-Google-Smtp-Source: AGHT+IEm/dG4AusBTV0/kye4fgwoOHE3T1Ed7cDQQlIyPOAnYB4dhzazUs1UbT3gBPF/9ZY7TUID6gosQY89FM7AT1w= X-Received: by 2002:a17:90b:224e:b0:33e:2d0f:479b with SMTP id 98e67ed59e1d1-34733e4683cmr12525299a91.6.1764000197200; Mon, 24 Nov 2025 08:03:17 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Mon, 24 Nov 2025 09:03:06 -0700 X-Gm-Features: AWmQ_bl0uQ_htB3uAnvUEdgsgvrv3hnQj7_mXaH8Axe6xqrWud0M0S961qkSVDk Message-ID: Subject: Re: [PATCH] df: correct BLOCKSIZE handling for -k to use 1K-blocks (290710) To: Ankush Mondal Cc: hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000235ca60644594dc7" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dFVwm0m2Jz3tsj --000000000000235ca60644594dc7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think this is the wrong direction of the fix. POSIX-2023 states: STDOUT When both the *-k* and *-P* options are specified, the following header line will be written (in the POSIX locale): "Filesystem 1024-blocks Used Available Capacity Mounted on\n" and so this goes from the recommended form to a non-conformant form. While the implementation is free to use 1k instead of 1024 when -P is not specified, I think this change will break that. Also, we generally don't do code reviews in hackers@. Your best bet is likely a github pull request. I'll keep my eyes open there. Warner On Mon, Nov 24, 2025 at 5:38=E2=80=AFAM Ankush Mondal wrote: > This patch fixes the inconsistency in df -k header formatting described > in Bug 290710 > . > > Before : > root@bsd:~ # df -k > Filesystem 1024-blocks Used Avail Capacity Mounted > on > zroot/ROOT/default 65618056 4716712 60901344 7% / > > After : > root@bsd:~ # df -k > Filesystem 1K-blocks Used Avail Capacity Mounted o= n > zroot/ROOT/default 65618056 4716712 60901344 7% / > --000000000000235ca60644594dc7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think this is the wrong direction of the fix.

POSIX-2023 states:

STDOUT

When both the=C2=A0-k=C2=A0an= d=C2=A0-P=C2=A0options are specified, the following header line will= be written (in the POSIX locale):

"Filesystem 1024-blocks Used Available Capacity Mounted on\n"
and so this goes from the recommended form to a n= on-conformant form. While the implementation is free to use 1k instead of 1= 024 when -P is not specified, I think this change=C2=A0will break that.

Also, we generally don't do code reviews in hacke= rs@. Your best bet is likely a github pull request. I'll keep my eyes o= pen there.

Warner

On Mo= n, Nov 24, 2025 at 5:38=E2=80=AFAM Ankush Mondal <ankushmondal1y2t@gmail.com> wrote:
=

This = patch fixes the inconsistency in=C2=A0df -k=C2=A0header format= ting described in=C2=A0Bug 290710.

Before :=C2= =A0
root@bsd:~ # df -k
Filesystem =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 1024-blocks =C2=A0 =C2=A0 =C2=A0 =C2=A0 Used =C2= =A0 =C2=A0 Avail Capacity =C2=A0Mounted on
zroot/ROOT/default =C2=A0 =C2= =A065618056 =C2=A0 =C2=A0 4716712 =C2=A0 60901344 =C2=A0 =C2=A0 7% =C2=A0 = =C2=A0 =C2=A0/

After :
root@bs= d:~ # df -k
Filesystem=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01K-blocks= =C2=A0 =C2=A0 =C2=A0 =C2=A0 Used =C2=A0 =C2=A0 Avail Capacity =C2=A0Mounte= d on
zroot/ROOT/default =C2=A0 =C2=A065618056 =C2=A0 =C2=A0 4716712 =C2= =A0 60901344 =C2=A0 =C2=A0 7% =C2=A0 =C2=A0 =C2=A0/

--000000000000235ca60644594dc7--