public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zhang Yi <yi.zhang@huawei.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
	Gabriel Krisman Bertazi <krisman@collabora.com>,
	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
Date: Tue, 12 Apr 2022 20:51:07 -0700	[thread overview]
Message-ID: <20220413035107.GA16747@magnolia> (raw)
In-Reply-To: <fe9fcfcd-7c6c-19eb-525c-f8a79804481c@huawei.com>

On Wed, Apr 13, 2022 at 10:23:31AM +0800, Zhang Yi wrote:
> On 2022/4/13 9:35, Theodore Ts'o wrote:
> > On Tue, Apr 12, 2022 at 12:01:37PM -0400, Gabriel Krisman Bertazi wrote:
> >> Zhang Yi <yi.zhang@huawei.com> 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.
> > 
> 
> Yes, I understand that the kernel log is not reliable, and
> /proc/self/mountinfo neither. Our goal is simple, As Ted said, just add a
> method to help sysadmins to know whether a particular ext4 device is really
> doing unmount procedure, it could be helpful for us to debug kernel and
> locate kernel bug.

But if the mount/unmount messages are ratelimited, how will you know for
sure if the ratelimiting mechanism elides the message?

--D

> Thanks,
> Yi.
> 
> 
> 

  reply	other threads:[~2022-04-13  3:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 14:53 [RFC PATCH] ext4: add unmount filesystem message Zhang Yi
2022-04-12 16:01 ` Gabriel Krisman Bertazi
2022-04-13  1:35   ` Theodore Ts'o
2022-04-13  2:23     ` Zhang Yi
2022-04-13  3:51       ` Darrick J. Wong [this message]
2022-04-13  6:33         ` Zhang Yi
2022-04-13  8:16           ` Jan Kara
2022-04-12 16:40 ` Jan Kara
2022-05-13 21:15 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220413035107.GA16747@magnolia \
    --to=djwong@kernel.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.cz \
    --cc=krisman@collabora.com \
    --cc=liangyun2@huawei.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    --cc=tytso@mit.edu \
    --cc=yebin10@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox