Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp13531lfv; Tue, 12 Apr 2022 15:17:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI1LM8hWWlQxgZKjD7T4irkXYPnIaap3FmhANE6PFjnnxDJWcyR2TpTB/fNOoe6RIzgn1e X-Received: by 2002:a17:902:7d86:b0:156:434a:a901 with SMTP id a6-20020a1709027d8600b00156434aa901mr40443525plm.77.1649801828214; Tue, 12 Apr 2022 15:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649801828; cv=none; d=google.com; s=arc-20160816; b=Kxz4Hl4z7ZgRH9pwwnErV5N900WRG/esAC+RkaGtGRp9XQCdobbEF1aZ4ySm9gD3xJ MCIx87XN0PU4Sr4Ow1rD8QlpZSHSRBC/w9Gb9yxw7+wSqSvWUPwSc2omUYTyUPgvI5zW WAXKaO1lw4f+bOBaqDepXVvXkKEOa4FfimM1R3jfTfLsvGNvP3Y/3lUjMDNZXhMXNeJF dzl2qg5aGUGdrmVnTqIDUg59Z8iQ5AsEDfOu/tDvK9C3bN+pevGx3WPKw3/E7wPQKNWk IUEt7CxSQbqGG9icln4m0/r6FwiA1tbgF1WWZS1CyUf6zNVYsaTVsTjAIKODOVn4F6fA Mf5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from:dkim-signature; bh=F+70yX4zKBIT+63RZ5z9Q6CByBIqYiqwGLmYfJIRvnE=; b=pPj5ppAfiU6YgecYbIvr8m7bJ+zVm2aRFWuW5x7jVb54ilhuG2zC1LOFVmt5oCsrMu FfFFAsM/DLNBgDr4+53xGsmWAitj5dTAQctY0rrfuOR5g+aaec9T+K46B/PMfZBjR4sb B45tf22EkNxF6jIBZ2X0/YHzaN9IBQTydZPJNWTj6q8VyXPvIbC4QJkW65oRkyzBThwr qroR14UANXW+ZM/gWOfUVKBVhWg+pQ0hpOC1nX16VieGhyFhXSvRNH6x2kVMURz3kEkX y+x7exturZn/+63ZIQ+cMz8Qcl6ItZP6mLtS1vM/F+KOzEHxSy8L/dv/ayYqg0zGn50t cQTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Q2STFlVj; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lb14-20020a17090b4a4e00b001cab382d4e3si17033241pjb.49.2022.04.12.15.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:17:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Q2STFlVj; spf=softfail (google.com: domain of transitioning linux-ext4-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EA83A16A693; Tue, 12 Apr 2022 13:58:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237605AbiDLQEA (ORCPT + 99 others); Tue, 12 Apr 2022 12:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiDLQEA (ORCPT ); Tue, 12 Apr 2022 12:04:00 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C7D94E3AE for ; Tue, 12 Apr 2022 09:01:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 237BB1F43E3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649779301; bh=UmlI0ov6iXSmCIfRCqDAvCY7sRzc+oGQlKSZMdiln+Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Q2STFlVjvq+ku1t6e7DttaNVvdpzSsrBULgBg+tzLjS6+OX6OIsUN3cSFX8bhvXhC wBNuqOqxr96RxKVUlO8jFk9KX42v3Ek3kPUBZ9BsE6hJNsHEL2XCrxPIdsb48Jpcq5 EZQLyDmRPM9tJH5jGKjaFb6/7AZMQJvgSKPP9LiASALeZdci+PXdg6xaxlKjHz0xOu 6wrOBq3BtbM+uiwpvNiLy0QJLfj3H+0oYz99iw0OVY3KAMSEckc/sf1SCukZ9oZ785 ADK5Nk+GXMznl2lgCwxvVL/6PsVGRvg+aiiLKX5ALzbCJDoSA18Qs3B89o7l7Yf5sO YdPUHKUsave0g== From: Gabriel Krisman Bertazi To: Zhang Yi Cc: , , , , , , , Subject: Re: [RFC PATCH] ext4: add unmount filesystem message Organization: Collabora References: <20220412145320.2669897-1-yi.zhang@huawei.com> Date: Tue, 12 Apr 2022 12:01:37 -0400 In-Reply-To: <20220412145320.2669897-1-yi.zhang@huawei.com> (Zhang Yi's message of "Tue, 12 Apr 2022 22:53:20 +0800") Message-ID: <87pmlmcmu6.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Zhang Yi writes: > Now that we have kernel message at mount time, system administrator > could acquire the mount time, device and options easily. But we don't > have corresponding unmounting message at umount time, so we cannot know > if someone umount a filesystem easily. Some of the modern filesystems > (e.g. xfs) have the umounting kernel message, so add one for ext4 > filesystem for convenience. > > EXT4-fs (sdb): mounted filesystem with ordered data mode. Quota mode: none. > EXT4-fs (sdb): unmounting filesystem. I don't think sysadmins should be relying on the kernel log for this, since the information can easily be overwritten by new messages there. Is there a reason why you can't just monitor /proc/self/mountinfo? > Signed-off-by: Zhang Yi > --- > fs/ext4/super.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 81749eaddf4c..bdecf62f4b55 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -1199,6 +1199,9 @@ static void ext4_put_super(struct super_block *sb) > int aborted = 0; > int i, err; > > + if (___ratelimit(&ext4_mount_msg_ratelimit, "EXT4-fs unmount")) > + ext4_msg(sb, KERN_INFO, "unmounting filesystem."); > + > ext4_unregister_li_request(sb); > ext4_quota_off_umount(sb); -- Gabriel Krisman Bertazi