From nobody Tue Dec 28 11:43:23 2021 X-Original-To: freebsd-fs@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 BAAC71917D7D for ; Tue, 28 Dec 2021 11:43:26 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4JNXjT3n6Pz3mLW for ; Tue, 28 Dec 2021 11:43:25 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id A52186BC53B for ; Tue, 28 Dec 2021 12:43:24 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id 4WG6t9xPipvR for ; Tue, 28 Dec 2021 12:43:23 +0100 (CET) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id E68B76BC52F for ; Tue, 28 Dec 2021 12:43:23 +0100 (CET) Received: from mail.incore (localhost [127.0.0.1]) by mail.local.incore (Postfix) with ESMTP id E00041CA for ; Tue, 28 Dec 2021 12:43:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=incore.de; h= content-transfer-encoding:content-type:content-type:subject :subject:mime-version:user-agent:from:from:date:date:message-id :received:received; s=dkim; t=1640691803; bh=u/MbbVEMsFxZa3ZBDRi 1vQdr1bo3xNRed1RE2k12HFU=; b=LzYd2aF2N7mofJ4crZlqHzkYHlObwrby7a2 WZscwoA5EA72R26ciP2WyW5ddBmvMtM+55f1xWCF3XklY6TfqnRYOx9Ob08OcT+l te3xgSZ/dnjZYpk8kzwIcqvLHpnCZAx1gLFNKXeBE23d/d5RNeDibEITNmYGpi8p lqK93J/0= Received: from mail.local.incore ([127.0.0.1]) by mail.incore (mail.incore [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PXk63C_SS3wd for ; Tue, 28 Dec 2021 12:43:23 +0100 (CET) Received: from bsdmhs.longwitz (unknown [192.168.99.6]) by mail.local.incore (Postfix) with ESMTP id A0C101C7 for ; Tue, 28 Dec 2021 12:43:23 +0100 (CET) Message-ID: <61CAF85B.3010700@incore.de> Date: Tue, 28 Dec 2021 12:43:23 +0100 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Unnecessary WARNING when a snapshot of a gjournaled filesystem is mounted Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4JNXjT3n6Pz3mLW X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=incore.de header.s=dkim header.b=LzYd2aF2; dmarc=none; spf=pass (mx1.freebsd.org: domain of longwitz@incore.de designates 195.145.1.138 as permitted sender) smtp.mailfrom=longwitz@incore.de X-Spamd-Result: default: False [2.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.995]; R_DKIM_ALLOW(-0.20)[incore.de:s=dkim]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.145.1.138:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_NA(0.00)[incore.de]; NEURAL_SPAM_SHORT(0.95)[0.948]; DKIM_TRACE(0.00)[incore.de:+]; FORGED_MUA_THUNDERBIRD_MSGID(4.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:3320, ipnet:195.145.0.0/16, country:DE]; RCVD_COUNT_SEVEN(0.00)[7]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N When I mount on a FreeBSD V12 server a snapshot living on /dev/md0 of a gjournaled filesystem with mount -r /dev/md0 /mnt/var the kernel gives the following WARNING: dsssrvt3 kernel: WARNING: /mnt/var: GJOURNAL flag on fs but no gjournal provider below Of course the kernel is right, /dev/md0 is never a gjournal provider. I think this warning is unnecassary and a little bit confusing when mounting a snapshot. With the patch --- ffs_vfsops.c.1st 2020-11-17 06:48:00.000000000 +0100 +++ ffs_vfsops.c 2021-12-21 11:38:15.000000000 +0100 @@ -875,9 +875,10 @@ mp->mnt_flag |= MNT_GJOURNAL; MNT_IUNLOCK(mp); } else { - printf("WARNING: %s: GJOURNAL flag on fs " - "but no gjournal provider below\n", - mp->mnt_stat.f_mntonname); + if ((mp->mnt_flag & MNT_RDONLY) == 0) + printf("WARNING: %s: GJOURNAL flag on fs " + "but no gjournal provider below\n", + mp->mnt_stat.f_mntonname); free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; } the WARNING is gone. Because I was not able to write a simple request for the condition "mount a snapshot" I have used the condition "mount read only". I would like to know if this can be done better. Andreas