From nobody Fri Jan 27 20:51:53 2023 X-Original-To: bugs@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 4P3VB12cwVz3c4Cy for ; Fri, 27 Jan 2023 20:51:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P3VB10jXtz4LL3 for ; Fri, 27 Jan 2023 20:51:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674852713; 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; bh=1/NCuI6CYpvg/iy9nAXwEO3VupUnAEEE+u/DVx5uP0M=; b=Bmu4Di9q8XY87ZddBwuEmAFgHcMiojf0i6modRRgqu4ridxNN6A0SIfWHrwMdvweBmMLhH RpDk5+docsml4kwDUAO8O2tm6zIHd0VXYoSfmYAZBc0tEL1jlvgnQaJzyS17r6o1xwqVav jhj2ckfOSTxXdQTAx6kbhIXxfs3UZIR/OjycMwMTTWO3PJ4zp62IWMiLzbkcrrDp7xPhWp n46FrbLuRncGkSM6SkGJqso6NWWZBCX6krK2qYcBk2PNjSzJGo9u+odTfOoAihgOlr/iw6 xDqhSusWbGkDPN4G/7jXaTQoTmGaC1JT2NkgSzEw06uwrE27vdYRcE7k/ZES6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674852713; a=rsa-sha256; cv=none; b=ja5aqPbhRlf6zxBEfHkrptB6S5jmJFh1I5/UaY50SCCc9Y3qDHmn+5m/p5FM8VVNdfULNM qFHZ6AUfWNhQMilZZ7MSd+CJ22wmcxJANH9dvBHRJZg3bNPuYW5FUjtWWGz2JoCb/1gig6 K2rNw3HeWtbm765WM2k9zg5Ch7lhzo+PJ4RN8BqHTzkeLUBqyJYs3WNFSXZuprQmy2Qpzh KAxKT1kBVGXD0ArZ6E8RZfz7b6GNb+Hp6m1WJuB4S6NO8kVO6bvCmVHbAV6VJBvXPnaZy9 4PHOFcAx9OFB6s6fRHVuS6zrOrllWEgS2iFG/S9kogD8FWKe0BYAHFXFvQKacg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P3VB06tr6zNNC for ; Fri, 27 Jan 2023 20:51:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 30RKpqV4005109 for ; Fri, 27 Jan 2023 20:51:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 30RKpq7T005074 for bugs@FreeBSD.org; Fri, 27 Jan 2023 20:51:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 269190] [patch] bugs in stat(1) and devname(3), wrong report on disk names Date: Fri, 27 Jan 2023 20:51:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: alexander.naumochkin@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269190 Bug ID: 269190 Summary: [patch] bugs in stat(1) and devname(3), wrong report on disk names Product: Base System Version: 13.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: alexander.naumochkin@gmail.com Created attachment 239747 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D239747&action= =3Dedit patches lib/libc/gen/devname.c and usr.bin/stat/stat.c If I want to know the name of the partition a file is on I run stat(1) with= the -f "%Sd %Sr" option and it always reports #NODEV #NODEV. I checked out the stat(1) source code and found that it always calls devname(3) for dev_t with S_ISBLK mode, which is gone since FreeBSD 6.x AFAIR. Also during my investigation I figured out that devname(3) has 10 years old bug: when it tries to check that the `type' is one of S_IFCHR or S_IFBLK, it applies S_ISBLK macro to `dev' instead of `type'. patches attached --=20 You are receiving this mail because: You are the assignee for the bug.=