From nobody Thu Jan 18 16:48:25 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 4TG7wn5jbKz56SWL; Thu, 18 Jan 2024 16:48:25 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG7wn53fwz40hq; Thu, 18 Jan 2024 16:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596505; 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=RUpSOaHdLhvP4YQwWg4MX7viEDU+mjfaHo1np8F1Nr0=; b=S4ryzYRzQBuv/dmxX1BQfnmQmsf5/Qqn0VvqQ1xWpuwhqVyVvbD5DXBEmdxjy/P+XvDBOZ CptDoiJ55ZLEjhTmmUcC4+MyL1zB239+hwpWZ0SJo8Dl36zAUfVP5fMo+ExB+S+Z72WFxM 1Fy8oYtwedCBHGqh9zvoEAEstoyGS1/hYygSQaetBZ624Ov30fQNfzhav22bMe7J6UB5oX a9jkBB1+A0ivu8TyzTsWMwUdeRGKAKX1F0y58A6eubgsnhobvZYyq/1kOOrVOVRYPvDycP Aa+EeWDZ7caFZo+Pw8nMMCCv5ObYmyq4V7iwTv0SNl6XUC+KU6hjqIDRNhYj+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596505; 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=RUpSOaHdLhvP4YQwWg4MX7viEDU+mjfaHo1np8F1Nr0=; b=GRCNkqk+WZIPB5sroN/YSzisuThBThCkLtgGUqaqhbEPU836pDxPSDGt1D2bBmi3D36xs/ B7stRbkVXyvd0+8rOvweqEMgWTopd0xhA4ad61ENgM1kHeD55Lq3sFcvNys5aYCS9MbOZ1 CGRNXtNVSRRqzY2ILTEamb+aJsgsdaBPWpk7qJre+ViL0CmHH/xyQWIPA2D5M+quR6bTKy /40mXmqvaUf2s4eTjP22HLk6J6Ba7/54dwW9M18Ozajfhnqak9FIEoj4q1ZLTxAYcnoRlO dt/Jyb7fagnOBvcq2IILWmVa8sUmY9P76oUEaInDEvJpTJqK3GanKkIvBD9dlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705596505; a=rsa-sha256; cv=none; b=IGhNlgLgf6cIUtPO2ExMaXPcwSLILgrvZyW+FhAC4TNtURNRfE/5l7y0mRtxQcbToGrFW/ flwWXHxMeNTYQeiPymbsTmW0auGE0bjAEIRK0y6sqmtw+0XX7kS6QZq07URJ+Nu8xbz3rr Hrq9WDqhKw2yOjCfxNIitJYbexMKw6IaXsHWWRXwfudnkV1Bo22a+Gi3dyBKAQYEALFq3q 2mtv+QukxBu0ZfaZZTqWyKd4KZVlv2KWiHZcbl0RJF+1GbiyudI9g5pZHHX6Nqt87rpYK3 i9XEHrN85Mp9b3lVy23S3Y4oKDLza21Q05/rpp12XbdDOAqUS1gIKOPXfRLBgg== 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 4TG7wn46B5zFCF; Thu, 18 Jan 2024 16:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IGmPlW013088; Thu, 18 Jan 2024 16:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IGmPmk013085; Thu, 18 Jan 2024 16:48:25 GMT (envelope-from git) Date: Thu, 18 Jan 2024 16:48:25 GMT Message-Id: <202401181648.40IGmPmk013085@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: be0df84849ff - main - msdosfs_rename(): handle errors from msdosfs_lookup_ino() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: be0df84849ff3e8fb5ec65176ffde88dbefdc434 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be0df84849ff3e8fb5ec65176ffde88dbefdc434 commit be0df84849ff3e8fb5ec65176ffde88dbefdc434 Author: Konstantin Belousov AuthorDate: 2024-01-17 22:55:05 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-18 16:48:05 +0000 msdosfs_rename(): handle errors from msdosfs_lookup_ino() Properly working storage and correct filesystem structure indeed only allow the EJUSTRETURN return code, but since the called function needs to read directory blocks and (re)parse the content, the assert is not neccessary hold. PR: 276408 Reported by: John F. Carr Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43482 --- sys/fs/msdosfs/msdosfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index c17d9f785dc2..726b1d8e5cb7 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1180,8 +1180,8 @@ relock: memcpy(oldname, fip->de_Name, 11); memcpy(fip->de_Name, toname, 11); /* update denode */ error = msdosfs_lookup_ino(tdvp, NULL, tcnp, &scn, &blkoff); - MPASS(error == EJUSTRETURN); - error = createde(fip, tdip, NULL, tcnp); + if (error == EJUSTRETURN) + error = createde(fip, tdip, NULL, tcnp); if (error != 0) { memcpy(fip->de_Name, oldname, 11); goto unlock;