From nobody Sat Aug 24 17:44:18 2024 X-Original-To: fs@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 4WrkpC2xnBz5TWHx for ; Sat, 24 Aug 2024 17:44:19 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WrkpB5SDTz4Nd8 for ; Sat, 24 Aug 2024 17:44:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724521458; a=rsa-sha256; cv=none; b=QOp9vIPzhKFvDeMTOzeKj50CMPm/J/Y1ZU6SV7/D8vEtUMraXDMUhlixjkor7sdlL2vo3e 6Go6hBh64Yq45GnSHkN16YKZxGnKV4rCpr3ds0pli0j0/uVqCBYsedfzgQCo7W6aFG2QYO mkcZLLUnRBvXh783uRQafkkwlIdOP564y7qScUXka4DBTxAYRSBkHyx/d20DiXUY2j30jY bikIHkjwNqEq8jW5NUiqkhNfEvzrtabrIcG2KxrJu3gzpwaYiVzeYYslnTqdwZgKInIGBI KGIt//FZdh0EwbM+6k8XfrnGRQywKEQO/6W+z3lnSBHQ3iCw5bscFksM8XSLKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724521458; 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; bh=DamBCwKlrm7D1fiY1LxujVM1Q/LYz5UxnJ2RxdbPJds=; b=U1sTO1cGyJQg4g72mQ/OfTn3PtrOU2mP9IX9jwTKfWk8X85q0PntnNYYif74B/JUhrhGG6 RhhQUzszJ9Ag+yJfzchXYfvmZPT/ikETW6mxUcry1RuiLp9w5OZqA+ymo0BUciY1q/P258 3NMkTYeFcZiBZj+fD2Cbpa1IUZ7gK+PTOT9MPHNUSMedz28tsTc1kIO0WNNjt/85oFxo6P 9mFTHxcredSfhk3OklgQZRHjJex+yZ746p74GoXznjZ0pInB1PDZgQ8p30ZYzl6K9sFyVj hzEnBdlmteub4nzmUZefr7kmYs5dfcVAetCpP4dYjb6YiyPsACI7E8F0jpHGPQ== 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 4WrkpB4yVSz14N7 for ; Sat, 24 Aug 2024 17:44:18 +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 47OHiIHA069608 for ; Sat, 24 Aug 2024 17:44:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 47OHiIqu069602 for fs@FreeBSD.org; Sat, 24 Aug 2024 17:44:18 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: fs@FreeBSD.org Subject: [Bug 281033] [msdosfs] rm -f fails Date: Sat, 24 Aug 2024 17:44:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: se@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: se@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc assigned_to bug_status Message-ID: In-Reply-To: References: 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: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281033 Stefan E=C3=9Fer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |se@FreeBSD.org Assignee|fs@FreeBSD.org |se@FreeBSD.org Status|New |Open --- Comment #1 from Stefan E=C3=9Fer --- The patch that has been discussed as GitHub pull request 1329 (https://github.com/freebsd/freebsd-src/pull/1329) will be attached to this= PR. It has an undesirable side effect: the mv command returns "No such file or directory" instead of "Invalid argument" when the target file name is inval= id: # touch /boot/efi/A.DAT # mv /boot/efi/A.DAT /boot/efi/B*.DAT mv: rename /boot/efi/A.DAT to /boot/efi/B*.DAT: No such file or directory This is caused by namei() being called with the target filename and that invokes the patched msdosfs_lookup() and thus gets and returns the changed error code. But since the patch affects namei() and functions that call it, more vnode operations will return ENOENT instead of ```EINVAL`` with this patch (when given an invalid MSDOS file name on an MSDOSFS file system). The rename(2) man page mentions both EINVAL and ENOENT, but neither descrip= tion mentions the case of an invalid target file name: [ENOENT] A component of the from path does not exist, or a path prefix of to does not exist. [EINVAL] The from argument is a parent directory of to, or an attempt is ma= de to rename =E2=80=98.=E2=80=99 or =E2=80=98..=E2=80=99. Maybe the case of a target name not allowed on some file system should be added, e.g. one of: [EINVAL] The from argument is a parent directory of to, or an attempt is ma= de to rename =E2=80=98.=E2=80=99 or =E2=80=98..=E2=80=99, or the target filena= me is invalid. [ENOENT] A component of the from path does not exist, a path prefix of to d= oes not exist, or the target filename is invalid. If changing the return code of rename() (and possibly other system calls th= at return the error code of a failed namei() call unmodiified) is acceptable f= or this specific error case, I'll commit the patch to -CURRENT, but I'm not su= re whether POLA will allow merging to -STABLE. --=20 You are receiving this mail because: You are the assignee for the bug.=