From nobody Tue Apr 23 04:52:49 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 4VNqVp3tTCz5JQRc; Tue, 23 Apr 2024 04:52:50 +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 4VNqVp0yMlz4Yf6; Tue, 23 Apr 2024 04:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713847970; 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=G9U2Lh40M+gicnhonok4u/4v52XIzBfsfp7P0916JOk=; b=HUd0Zgvybbc2ai92xLk7JLNsngoMM7SjdmOluiksJ5kNCFuLsN7/riOr4fNZr7Xl7E5hxX pNKKYzlslu8YJlt7RQa4N+O/wq4M0I7wNz2C1au+3jqMCB5ONrIZY/sYep7788BEz4Au4l +38tojGHaieyuQ1cxuQ1QMy5uEhgNxTAC5ONre+lRmRrE+Ss2mrL5eBnizQUTHMyahsHBm jRZ+sDJT0Qo6/WCeYFKA8fIFO2U25+UCNUr0huUohxXrMy9pBRjZ70PUy7tJLhv/owQ1Jw 5fgVNdN+tAwbHsMzBxRXO83DoJgLuXjqVwOoikSKbFhKtyqYiS2z41ran1wagg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713847970; a=rsa-sha256; cv=none; b=QCWun6BIxYrSyrWjwREi4cTTgNFmgmIIYkWs54xf/RJZKNg5bwcgAs4JL6aqdIRBQPi64H jWMo5pYzb5Exdqitpbpy6OYzp1nCrIbffDKOCI7rnDVUw014Vq4O1Qx6fBL3y9WOf4JWdV dELnubiqpx6IphkRvvoS0NhMlWRItZ3CyrFWELpEtXvzUknMqcW2jnk1GqELn4sIrhRtvZ q0uRxT5NFZ6O+Wr0LmEX0sD3cfbXyMZ7fHMDl1R+ThbWRUOquNjHpUgGb0jFTWgXLmYsM/ uMjrM6yV4iG3QfIqv6oUWy2EYENuh1xGFG1Jo+F5YcPfeHtxpN5hMJa+6ZmSdA== 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=1713847970; 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=G9U2Lh40M+gicnhonok4u/4v52XIzBfsfp7P0916JOk=; b=SFNEEfALFfLBQAd+k3mCUF6s0wKfS1xUcrAfvYzZ8c7WH6LbDy5snZjHFQJBl3tbdp4BSO jWp02o6CTRGMoVjyeo/bFb/sMcOP0FkffMNpyRlhnyniKGXvLQzmO8Ui+DzzDcTz1NadWy 0JZO9aCh6Rcq7bBQHORbonB/Mszo4YaD5F6mQu8/ie//SDUvpFh02+c8K9CqKUfGY97l0i wvSuGqjUZ3BMkiOZUgqJrokr98ONH53itG+a54+WQlNLC3lxd47eokd61fd/opRzsaUF6n hB6hbsXfpGTTIkbz5bKDobjKB6pe+1oFep8y6u1dyC9qgY6sLnTuis2zCFRUPA== 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 4VNqVp0VlrzHjp; Tue, 23 Apr 2024 04:52:50 +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 43N4qnwr063967; Tue, 23 Apr 2024 04:52:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43N4qnCC063964; Tue, 23 Apr 2024 04:52:49 GMT (envelope-from git) Date: Tue, 23 Apr 2024 04:52:49 GMT Message-Id: <202404230452.43N4qnCC063964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e96d0d746844 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e96d0d7468446d7cabd76ae213889297711bb144 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e96d0d7468446d7cabd76ae213889297711bb144 commit e96d0d7468446d7cabd76ae213889297711bb144 Author: Ricardo Branco AuthorDate: 2024-04-22 22:08:58 +0000 Commit: Warner Losh CommitDate: 2024-04-23 04:36:35 +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 --- 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 5314f8e0c56f..c15fd13d065a 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -673,19 +673,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); }