From nobody Mon Dec 05 22:50:55 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 4NQzKr08GKz4jpF0; Mon, 5 Dec 2022 22:50:56 +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 4NQzKq6nxRz40ft; Mon, 5 Dec 2022 22:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670280656; 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=Cjq2JeWPKWvw6KlBHKFik69jYxwjPQYrakPNCv8rbic=; b=FYv/w1fpzwvGBW9GjC2iqj532VnfTTsc86et15PjBQ5wqs/xqnvc6kdxV6D3SHswg7kJIj dhzXI/XivBhq76XUl1NZhc2+hukW0anWALDylKusjWdAItQBo3WvomH9KHX1l2G2vS4x2p EBmy0m0RvbsxR2ZKQf3EyFrDiHFuvh0Cq3EAZzyo3P2MQ6jo+/wxaS6r+4EECGIW9gYEzp /qNo2rgbGUyl2jDVb0ATU9pzTToU4ksl4AbL4KSrsczB4f8X5r3kqIenEyigGsBK7kvNEr NQ+clc++WzOSTQZ4afleHA8/QT68ngNIYdfderYwIwAG3AB9LHdMAxorsr+wmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670280656; 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=Cjq2JeWPKWvw6KlBHKFik69jYxwjPQYrakPNCv8rbic=; b=nvk9NfYPfX2vjl+yQAQiphR4XsVwUhsmjgaKQETbrpAZzb3Sik89rIfW1+vkpm7K4Ty5B9 /MDJWYTjuzyPVA3PxS+rvMDdoAYd6A3ZxOzTPmlukR+XJRdUBcJizIomvJ5hpite1+cotn qCGoyQ4bhFQDtRAmn20NX654MbOtpQkaVv3ceZbOzzAbSkYsqJWT9GWBfzj/UOzLEAFM4/ sXWhQtxbFK9dIarCNSYHwrMxBthE++tJcSGPqvn5SyLdmKkP4qCTZ0nzDSRbmt7teL1ows F3AAnXYt6BpgfkJHFSYISdayOW2FmK1G72/lJ593pJmpQcpUjk+BzvFCOHAyFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670280656; a=rsa-sha256; cv=none; b=sSnxAGxERTlcM35an4kv0Zn3FPBk7oaCDADgWoqF272IJxy4pZPabSt4/zDwOsFEV+GoxV qpjUkndFYPwr1QBTpBas/cxO5TAMXUm8KC50I4fKgHD0QygbnDDR9cpsULHGW/VKHHtZ5j X6fyR7g9DtrotPLkwu+TPJTbMgXofgvYMnaVRL6BLtbVrUloZWQbEPZpmCOLqmbQxchknm smU8+TpVLLExQq7QnodH9O5upAS8W9dACEWoEUdmVAph73x15iU3g5ql2x4/AGlm20yAZ1 2Wb+JrWa53JHQGc+9i4ZgQNzsci0iTjGqxKbw1VL7gBzV2KLndmIuWlP6GZL4A== 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 4NQzKq5tGDzFHj; Mon, 5 Dec 2022 22:50:55 +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 2B5Motek078466; Mon, 5 Dec 2022 22:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B5MotBu078465; Mon, 5 Dec 2022 22:50:55 GMT (envelope-from git) Date: Mon, 5 Dec 2022 22:50:55 GMT Message-Id: <202212052250.2B5MotBu078465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 08e5f519b21d - main - Provide more precise mount(8) failure message. 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08e5f519b21dfcc7543c41c14d066b2d015fbf5c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=08e5f519b21dfcc7543c41c14d066b2d015fbf5c commit 08e5f519b21dfcc7543c41c14d066b2d015fbf5c Author: Kirk McKusick AuthorDate: 2022-12-05 22:47:24 +0000 Commit: Kirk McKusick CommitDate: 2022-12-05 22:50:42 +0000 Provide more precise mount(8) failure message. Suggested by: Xin LI Reviewed by: kib PR: 19683 MFC after: 1 week --- sys/ufs/ffs/ffs_vfsops.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 8f6e186b44b2..54a24b7058f8 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -604,11 +604,12 @@ ffs_mount(struct mount *mp) (FS_SUJ | FS_NEEDSFSCK)) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { printf("WARNING: %s was not properly " - "dismounted\n", fs->fs_fsmnt); + "dismounted\n", + mp->mnt_stat.f_mntonname); } else { vfs_mount_error(mp, "R/W mount of %s denied. %s.%s", - fs->fs_fsmnt, + mp->mnt_stat.f_mntonname, "Filesystem is not clean - run fsck", (fs->fs_flags & FS_SUJ) == 0 ? "" : " Forced mount will invalidate" @@ -810,8 +811,8 @@ ffs_reload(struct mount *mp, int flags) UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " - "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, - fs->fs_pendinginodes); + "files %d\n", mp->mnt_stat.f_mntonname, + (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; } @@ -974,10 +975,11 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) ((fs->fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { printf("WARNING: %s was not properly dismounted\n", - fs->fs_fsmnt); + mp->mnt_stat.f_mntonname); } else { - vfs_mount_error(mp, "R/W mount of %s denied. %s%s", - fs->fs_fsmnt, "Filesystem is not clean - run fsck.", + vfs_mount_error(mp, "R/W mount on %s denied. " + "Filesystem is not clean - run fsck.%s", + mp->mnt_stat.f_mntonname, (fs->fs_flags & FS_SUJ) == 0 ? "" : " Forced mount will invalidate journal contents"); error = EPERM; @@ -986,7 +988,8 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) if ((fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) && (mp->mnt_flag & MNT_FORCE)) { printf("WARNING: %s: lost blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + mp->mnt_stat.f_mntonname, + (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -994,8 +997,8 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: mount pending error: blocks %jd " - "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, - fs->fs_pendinginodes); + "files %d\n", mp->mnt_stat.f_mntonname, + (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; }