Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp360630pxb; Wed, 13 Apr 2022 02:50:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCsd/+Pi7DGuFj6UxhnvC3aEsE0vkYlsRu8CFNJJn++5WK+rb1jsYgg38mxVSbKZnm6nyx X-Received: by 2002:a17:906:4789:b0:6e8:7ab7:e843 with SMTP id cw9-20020a170906478900b006e87ab7e843mr15807383ejc.374.1649843423624; Wed, 13 Apr 2022 02:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649843423; cv=none; d=google.com; s=arc-20160816; b=O2imxm+BwvMzHYc1iR9kU0wte2K/wdFDcjyXF33mHJhrFPLpIIybOwlMUvpDli014X zuYvlRBu24m8vYWhCkrDoKr7F5fMfJoNR43UxSma1iBA0Tbra60Q4dj9xk+rbWzvPPhR YPpYyHyu7hcae7gkifQbVBriBPwsMi7grXzknpy9g5NRw3nBrPm0v5+MrRjbX38ab3/+ 1BmR4AKI03b723Gpgci4thTQqI4sbY9qz6XD79KPjPR1BqqudoM59sK8WF/FDoRhBKOt Di3xoNwryKcaQoRgfMMbKVherCmWAWhbIf+eCH1A6uW2KCRnWAVaSb0ED4wMv8/2OCkv K3Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=OdZposaQHdhgbjporrWNOnDwWVWD94HyPAieiiCSp3k=; b=ksadnWbJYJ1AKtEmoxgJAUvcqTMdOx74gNXlLEuMghPr3n0hLOkPaHhRJB/yoYYJJz 2FkQjJANlEGCEcJlMKqvzwVued17l97Oa+Z2fwAjrmsNdcqkpKeJkjgdEQzzrJfdU6Ga SLkC4UBIIP88ywOCUGLqubxEON+PmbIrXoLFcByLy+A3NjXaNWzfzMAHP9r1J7g5oX40 58sXvtROw2gOV5lnt+4KWAqfY1rxgQNU/6WIwMGAyM4ym9BpVJsEFgZFeCmqj0EK3c7o OkkCtTtxUWry7PXkanAz9aKhEy0STo3v1+FjFJ/iwYQSizL0H1cWOiSu7QIoOgm1q+ph uFCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gj14-20020a170906e10e00b006e89d977b2fsi4794831ejb.917.2022.04.13.02.49.49; Wed, 13 Apr 2022 02:50:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbiDMBip (ORCPT + 99 others); Tue, 12 Apr 2022 21:38:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiDMBio (ORCPT ); Tue, 12 Apr 2022 21:38:44 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DCC444757 for ; Tue, 12 Apr 2022 18:36:24 -0700 (PDT) Received: from cwcc.thunk.org (pool-108-7-220-252.bstnma.fios.verizon.net [108.7.220.252]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 23D1Zumo012270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Apr 2022 21:35:56 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 3627F15C003E; Tue, 12 Apr 2022 21:35:56 -0400 (EDT) Date: Tue, 12 Apr 2022 21:35:56 -0400 From: "Theodore Ts'o" To: Gabriel Krisman Bertazi Cc: Zhang Yi , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, jack@suse.cz, yukuai3@huawei.com, yebin10@huawei.com, liuzhiqiang26@huawei.com, liangyun2@huawei.com Subject: Re: [RFC PATCH] ext4: add unmount filesystem message Message-ID: References: <20220412145320.2669897-1-yi.zhang@huawei.com> <87pmlmcmu6.fsf@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pmlmcmu6.fsf@collabora.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Tue, Apr 12, 2022 at 12:01:37PM -0400, Gabriel Krisman Bertazi wrote: > Zhang Yi writes: > > > Now that we have kernel message at mount time, system administrator "Now that we have...." is a bit misleading, since (at least to an English speaker) that this is something that was recently added, and that's not the case. > > 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? You're right that it can be dangerous for sysadmins to be relying on the kernel log for mount and umount notifications --- but it depends on what they think it means, and the potential pitfalls are there for both the mount and unmount messages. The problem of course, is that bind mounts, and mount name spaces, so if the question is whether a file system is available at a particular mount point, then using the kernel log is definitely not going to be reliable. But if the goal is to determine whether a particular device is safe to run fsck or otherwise access directly, or for the purposes of debugging the kernel and looking at the logs to understand when the device is being accessed by the kernel and when the file system is done with the device, I can see how it might be useful. Cheers, - Ted