From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: add dmesg output when mounting and unmounting
Date: Mon, 13 Nov 2023 18:45:02 +0100 [thread overview]
Message-ID: <20231113174502.GX11264@twin.jikos.cz> (raw)
In-Reply-To: <215e7eea95459d1b0cc4fd9ce522dc7c8f5d4e02.1698873846.git.wqu@suse.com>
On Thu, Nov 02, 2023 at 07:54:50AM +1030, Qu Wenruo wrote:
> There is a feature request to add dmesg output when unmounting a btrfs.
>
> There are several alternative methods to do the same thing, but with
> their problems:
>
> - Use eBPF to watch btrfs_put_super()/open_ctree()
> Not end user friendly, they have to dip their head into the source
> code.
>
> - Watch for /sys/fs/<uuid>/
> This is way more simpler, but still requires some simple device -> uuid
> lookups.
> And a script needs to use inotify to watch /sys/fs/.
>
> Compared to all these, directly outputting the information into dmesg
> would be the most simple one, with both device and UUID included.
>
> And since we're here, also add the output when mounting a btrfs, to keep
> the dmesg paired.
>
> Now mounting a btrfs with all default mkfs options would look like this:
>
> [ 81.906566] BTRFS info (device dm-8): mounting filesystem 633b5c16-afe3-4b79-b195-138fe145e4f2
> [ 81.907494] BTRFS info (device dm-8): using crc32c (crc32c-intel) checksum algorithm
> [ 81.908258] BTRFS info (device dm-8): using free space tree
> [ 81.912644] BTRFS info (device dm-8): auto enabling async discard
> [ 81.913277] BTRFS info (device dm-8): checking UUID tree
> [ 91.668256] BTRFS info (device dm-8): unmounting filesystem 633b5c16-afe3-4b79-b195-138fe145e4f2
On a fresh look, I' suggest to write the messages like
BTRFS info (...): first mount of filesystem UUID
...
BTRFS info (...): last umount of filesystem UUID
This is not for each mount so it's slightly confusing.
next prev parent reply other threads:[~2023-11-13 17:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 21:24 [PATCH] btrfs: add dmesg output when mounting and unmounting Qu Wenruo
2023-11-02 1:16 ` Anand Jain
2023-11-02 20:18 ` David Sterba
2023-11-03 5:02 ` Qu Wenruo
2023-11-13 17:45 ` David Sterba [this message]
2023-11-13 20:07 ` Qu Wenruo
2023-11-13 21:09 ` David Sterba
2023-11-14 0:38 ` Anand Jain
2023-11-14 11:12 ` Anand Jain
2023-11-14 12:03 ` David Sterba
2023-11-21 5:18 ` Anand Jain
2023-11-21 7:27 ` Anand Jain
2023-11-21 12:38 ` David Sterba
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=20231113174502.GX11264@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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