From nobody Sun Aug 25 15:02:26 2024 X-Original-To: dev-commits-src-all@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 4WsH8y3bF9z5SxwZ; Sun, 25 Aug 2024 15:02:26 +0000 (UTC) (envelope-from git@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 4WsH8y391lz4lK1; Sun, 25 Aug 2024 15:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724598146; 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=Yiy3woQYQdQ6b+eDY6UC8u4noejQab4LfUuAkTuG88c=; b=IZxvPSSwO2LFbjpJConir0hiGAoIVLE6m+kM4KwIL8rHvTdpj0JEWvqaygjlqR7Lg3H9X3 /oXw7iKdZzX5wfJOErb6hEhE2xDUzA1GXmxpLJcdqZ6DGIcXVDIvpUm9nXFSIpo57+/LAo 9XDj4k+138ejQrjK3VByY+a2Rjocug6EUcwdLVitx7UVsZoNzzOL7tFU+WXTHK1DKnOm3w Ek4mTUPa7iZXX+uzFOX+I75Sp/Ti2bWfCuiddVn8YE6QuWabrFiqhlzgEXxet5E9G7hqtT eyGEdHKEwLiIvrfAGqv8eFqJq8IjxYyK80jl9G2/jOdwzj9ZBH6Rc3RKTJeRZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724598146; a=rsa-sha256; cv=none; b=WtiqeCMBoUykyxT9kIdZKT8RY6hIEHVYqVrb1tYRMNMvFxBUfunmfKl/LjtZ/0YuXyNTrt 0mz6xEU/prdI8xPeo8KImv0pPuUHzFn/SCEx1y1VXJuNk7y5YZqohnVlVtS/XdF87IlhRL tfxmX1KdGjd2GfIbXaWUwLx+kqJExuLkSqvdDy7nGUe5IghsaR2cupa9aZk8EsPrL3jWqf TAmuBFA+4x9ER9aQVczvPXF3DVpsX5HotEZcMhiLdW8x/sG7/qz0Hl/pAtZ3hcBQ2OI51A 94Mq1aCw9fKjGC0jjVvwHB6MRUc5N3pnzHYy7jFWkj1CDF7SaNT3/i05DzXViA== 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=1724598146; 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=Yiy3woQYQdQ6b+eDY6UC8u4noejQab4LfUuAkTuG88c=; b=AGboEQSllsop0YwB1zokywVzPks09/QEON8pQS/uClOfFK4xz050fnMSbkJx1If0+IB5AP ZDeLjVd8bYg2JPg5nQ82OD05BnDotU9f7G/e8Uaffr3DikMjS+Nwqw++y5IDQPg+hQtE9W SEkp20Mxu1KS4QYSTUtzaeDHlBoNmtQ1Ar8+p/hsiw3zCw5qWGvY3FfkQr1B8gfHahBFSa BlgDR/y307gvo3xUEFisNKzsF1JnJGBjnQniKBXcAM4COAOqeqhYkFDU00wrzNA3Oz8HHS LkOWDyorXlvgOZ6hUXh1s4UoY3RMPKshyhi98prcokhyYF8HEZn5BDIZ8vklNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4WsH8y2mfmzS4K; Sun, 25 Aug 2024 15:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47PF2Qv9093953; Sun, 25 Aug 2024 15:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47PF2QDo093950; Sun, 25 Aug 2024 15:02:26 GMT (envelope-from git) Date: Sun, 25 Aug 2024 15:02:26 GMT Message-Id: <202408251502.47PF2QDo093950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0b2c159c8faa - main - msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0b2c159c8faa3ca155412a1b2e57b3d6bcf91880 commit 0b2c159c8faa3ca155412a1b2e57b3d6bcf91880 Author: Jose Luis Duran AuthorDate: 2024-08-25 14:50:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-25 14:50:53 +0000 msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE and keep reporting EINVAL for CREATE or RENAME lookups. The reasoning is that non-corrupted filesystem cannot have invalid dirents anyway, so returning ENOENT is more in-line with the natural behavior. PR: 281033 MFC after: 1 week --- sys/fs/msdosfs/msdosfs_lookup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 2a90339d0878..e799a5ce05f6 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -198,7 +198,9 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname switch (unix2dosfn((const u_char *)cnp->cn_nameptr, dosfilename, cnp->cn_namelen, 0, pmp)) { case 0: - return (EINVAL); + if (nameiop == CREATE || nameiop == RENAME) + return (EINVAL); + return (ENOENT); case 1: break; case 2: