From nobody Tue May 21 22:50:22 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 4VkV5B6Yw3z5L0ts; Tue, 21 May 2024 22:50:22 +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 4VkV5B5hK8z4YSp; Tue, 21 May 2024 22:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716331822; 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=BcTJ7Me4QghMx3dLJFCNz0muFWDxPiMf1kJ8rv1xXa8=; b=Q/IRKw8uCnPs+7jxKaxre7Z1du1U9e05xJaq/51Eeqzm4xFmdn7Pd/kxDKs0AYQ/DspDzE HWk2Dvv/fLC+xdUOYAOefFOr/ntwntmVIZ3YDsQ2IVD2lSbQUtb5DMD00E1rLmCCe4Q22b sYREWuIvBhaD0r6ICbsQFZCR3g+NRZyKBp/+jpC+JvX06B8gFVJLMuEWCth/WgGlkQyMqF HsTEhYcrPmGEk5NJ5tNvBgnOxP1ZbFWpjSb/U3hnv1YmC2LIzizOKGgqRfQgZGnDy9uEwy oqJUEWwHuneZoiFe2c26cRJ8VfWqIvx+07WLQpznQI7UwN1HXpCdVwK6PeUeoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716331822; a=rsa-sha256; cv=none; b=Zg/nxmuwqByU06KRhxzjZxmLe5TsKuOTBo7IEQB6nO8U9i9fLHSjWx2VVH7D+cBwEtBVsc evSO1g2q6FKOcjeLBq7VM7ekrM4zpGIeF3fQynkhHa64Z0mokZOgD7iq0v8fI3dnp8Yxdp Nq7oZ+y+nMf5R0cEJ9zWDu5IgeKjdWF8u2ccI5x2dYrnQ+O5gJx2fOr1WfCSA3cQkhm7CF shCfrIFE6U74TlLuchREXs+DOYnilDZyF1vOhj9rE2soZscEr6PWqvzXnp6cmZuCzLKZt1 /huVBoZrxqwDOOI0JMQ0Z7Yz7oKxCACMc4nIgEKiNHdAibTdbqxOxm6MbU6+EQ== 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=1716331822; 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=BcTJ7Me4QghMx3dLJFCNz0muFWDxPiMf1kJ8rv1xXa8=; b=rfk71LTJ4CCRnvygk8jZQyuOlhzZ/FoP6EWbnldgS3m0ol/C4aECtKMdy3W0HtgisPiuhw Blvzz0uvaiKcoPjisLmSOayjSS9qRGkyL+ha4qauRgoGeg2vqyyOufpfVvZd4Iar8i6Wnz krP8Cz93xoVylRg7KL7CNCMk21GVUTuWKOGNv/bXWhgTppQCpD8NOc3XrQxdDwvyzANE+Q BgwNKVRel/5Ll6SbwAM4TPLJHWW3LdorLo5XeOZqQH6q9Cfelq48Flb23H5//Pqvy0gTvq ITwNZYUSPqCtfDkmnqfLHhT9GI7BzQZtLPI5ja2hyvcfVG1/HmzebmWiKfc7zw== 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 4VkV5B5J7bzh1P; Tue, 21 May 2024 22:50:22 +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 44LMoMF8021567; Tue, 21 May 2024 22:50:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LMoM6d021564; Tue, 21 May 2024 22:50:22 GMT (envelope-from git) Date: Tue, 21 May 2024 22:50:22 GMT Message-Id: <202405212250.44LMoM6d021564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4de324578f4f - stable/14 - umount: Support partitions & slices with -d option 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4de324578f4f7d08ef5b2d3dbebe4f253c9511d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4de324578f4f7d08ef5b2d3dbebe4f253c9511d3 commit 4de324578f4f7d08ef5b2d3dbebe4f253c9511d3 Author: Ricardo Branco AuthorDate: 2024-04-22 22:08:58 +0000 Commit: Warner Losh CommitDate: 2024-05-21 22:50:01 +0000 umount: Support partitions & slices with -d option Signed-off-by: Ricardo Branco Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1183 (cherry picked from commit e96d0d7468446d7cabd76ae213889297711bb144) --- sbin/umount/umount.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index d1471076359c..4050524b9f2c 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -685,19 +685,17 @@ md_detach(const char *device) char *eptr; int fd; - memset(&mdio, 0, sizeof(mdio)); - - mdio.md_version = MDIOVERSION; - mdio.md_options = fflag ? MD_FORCE : 0; - if (strncmp(device, DEV_MD, sizeof(DEV_MD) - 1)) { if (!all) warnx("invalid md device: %s", device); return (-1); } + memset(&mdio, 0, sizeof(mdio)); + mdio.md_version = MDIOVERSION; + mdio.md_options = fflag ? MD_FORCE : 0; mdio.md_unit = strtoul(device + sizeof(DEV_MD) - 1, &eptr, 0); - if (mdio.md_unit == (unsigned)ULONG_MAX || *eptr != '\0') { + if (mdio.md_unit == (unsigned)ULONG_MAX || eptr - device == sizeof(DEV_MD) - 1) { warnx("invalid md device: %s", device); return (-1); }