From nobody Mon Feb 21 14:58:12 2022 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 A343919CB8CD; Mon, 21 Feb 2022 14:58:13 +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 4K2QQs1SzTz3vZ7; Mon, 21 Feb 2022 14:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645455493; 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=yf1hPg30TDp6lr7HBzw9WQSzymyLGh0QctzQVLzp1Rg=; b=UxcEML1LlSKua96MOT8UxN7kadx8/wBwP0bxBZ1kyg9xKaRVY2FBQbxkYdh8WaUg2GLFKr eq4Ldchcbzp2A+0cL+gfcPG7rBzdeUwlmSMQv4oN9JjiD3sEdFIcp3kP9zaQoNXsr89LzY H2JblXs6fOuV8736V18ednRa6po/qw6uZRP9/YwoZFLs2T3YAQr3ToQ13L+fELNemAvMbj tqiN81S3Eu4fgHbSGPxrhYX62p6m9R/eNk4OD98lb/qX7GtKVoxZLUnkJhJoavO9dmSyKa cDyl7YaJXM4CGNwDmNAdGIR0HJKHmN/22xvWjEGR8ZprePQaOEeD7bz2g/WiZA== 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 B43FD12399; Mon, 21 Feb 2022 14:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21LEwCPw086232; Mon, 21 Feb 2022 14:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21LEwCUB086231; Mon, 21 Feb 2022 14:58:12 GMT (envelope-from git) Date: Mon, 21 Feb 2022 14:58:12 GMT Message-Id: <202202211458.21LEwCUB086231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f8fa2f0e7577 - stable/13 - msdosfs: Fix mounting when the device sector size is >512B 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8fa2f0e7577c5f1cd4239cf73f5e11dcefe61d0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645455493; 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=yf1hPg30TDp6lr7HBzw9WQSzymyLGh0QctzQVLzp1Rg=; b=x5OYi8ZinNrSjVNIfDMk7+I9MnyMbMwbxzGNFuKprUBFkz/C4Hthwk7c+Of0mITKZMlcqI 6p+8EwdTzs0i92Qd0zp3FUeE3E4UWd5MjTjZ8CC/lGw0eDJy+NTyTwTuoP842Uo+ElnL+Q 6iVW97LEjlUtMBK2+nqSflWaxER5GGH8Ipe1hRNVRsQkOkXzkyO4+xBQ1WFd3HOzS51ipV XEsL3YsIRzRYC53VuYFaWokwjUq2KDDn8XUCH8cQ6kSvPq9ILzG1isFrHdUqSNakLeqD7p 8jJmOYiu0hAwjmPF0BzabWYc6iM89vBxNg2DxUNPc8Ln9HgFfqGlWHVKWjLwKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645455493; a=rsa-sha256; cv=none; b=PIbePgRcWDrB6G5Ma33UldOYYbn2uBi1f0J+wJGB00eFgLttUM2+c4M/vKlA/fWXw3iK7L 6xzCSJKCMvsNppopBVxWK7tKZx7C/KXfEU3CDuR06i6yozVE/Mp8QaX+smINsEuM/gm5MA uMPe2Y+lsmGAGj3DiGEGhj2CAD09ZePJLL9I7RZtXIDqCoTw/iKZUEwlJ+c/BSKEo+7jly ZhRG99vm/wXdJNbV8qbc/WtJl6ofEP1QWQlMude6qRxLUdLe3+pa8C8Ma/Upr1k28zvCxG SIVCoME3GnxTFsLWmFSPw2420LAEx1iAAun/grczU6sfnBxylT5niUV6fQjjMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f8fa2f0e7577c5f1cd4239cf73f5e11dcefe61d0 commit f8fa2f0e7577c5f1cd4239cf73f5e11dcefe61d0 Author: Mark Johnston AuthorDate: 2022-02-14 14:41:32 +0000 Commit: Mark Johnston CommitDate: 2022-02-21 14:57:54 +0000 msdosfs: Fix mounting when the device sector size is >512B HugeSectors * BytesPerSec should be computed before converting HugeSectors to a DEV_BSIZE-based count. Fixes: ba2c98389b78 ("msdosfs: sanity check sector count from BPB") Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit c7cd607a4e28233ab6679ee330c0a4836414bb0a) --- sys/fs/msdosfs/msdosfs_vfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 6eab1685ec8e..cbfb0aead8b7 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -577,7 +577,6 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp) goto error_exit; } - pmp->pm_HugeSectors *= pmp->pm_BlkPerSec; if ((off_t)pmp->pm_HugeSectors * pmp->pm_BytesPerSec < pmp->pm_HugeSectors /* overflow */ || (off_t)pmp->pm_HugeSectors * pmp->pm_BytesPerSec > @@ -586,6 +585,7 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp) goto error_exit; } + pmp->pm_HugeSectors *= pmp->pm_BlkPerSec; pmp->pm_HiddenSects *= pmp->pm_BlkPerSec; /* XXX not used? */ pmp->pm_FATsecs *= pmp->pm_BlkPerSec; SecPerClust *= pmp->pm_BlkPerSec;