linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Graham Cobb <g.btrfs@cobb.uk.net>
Cc: Anand Jain <anand.jain@oracle.com>,
	linux-btrfs@vger.kernel.org, calestyo@scientia.net
Subject: Re: "btrfs: harden agaist duplicate fsid" spams syslog
Date: Fri, 19 Jul 2019 17:38:50 +0200	[thread overview]
Message-ID: <20190719153850.GM20977@twin.jikos.cz> (raw)
In-Reply-To: <330f717e-c77c-f0b8-6b0d-b06249d58a81@cobb.uk.net>

On Fri, Jul 12, 2019 at 02:32:10PM +0100, Graham Cobb wrote:
> It is weird, because there are other symlinks also pointing to the
> device. In my case, lvm sets up both /dev/mapper/cryptdata4tb--vg-backup
> and /dev/cryptdata4tb-vg/backup as symlinks to ../dm-13 but only the
> first one fights with /dev/dm-13 for the devid.

'btrfs' utility has code to canonicalize the device mapper names and use
only '/dev/mapper' and not /dev/dm-*, but I think systemd/udev has own
utility for device scanning that might not do the translation.

> > One fix for this is to make it a ratelimit print. But then the same
> > thing happens without notice. If you monitor /proc/self/mounts
> > probably you will notice that mount device changes every ~2mins.
> 
> I haven't managed to catch it. Presumably because, according to the
> logs, it seems to switch the devices back again within less than a second.

This looks like some device enumeration takes any name for a given
device and calls scan on it. I have seen that eg. systemd tries to
deactivate a swap partition by all names it found under /dev/disk/* .

> > I will be more keen to find the module which is causing this issue,
> > that is calling 'btrfs dev scan' every ~2mins or trying to mount
> > an unmounted device without understanding that its mapper is already
> > mounted.
> 
> Any ideas how we can determine that?
> 
> Can I try something like stopping udev for 5 minutes to see if it stops?
> Or will that break my system (I can't schedule any downtime until after
> I am back)? Note (in case it is relevant) this is a systemd system so
> udev is actually systemd-udevd.service.

'udevadm monitor' can tell something about the device changes.

We still don't understand what happens but I'm inclined to think that
the fix should be in btrfs scanning code to print the message only once
for a given device with the first name.

The device path must exist in system and can be always traced either to
the /dev/dm-* or to /dev/mapper name, so it's maybe a minor usability
issue expecing user to resolve the path to see the pretty name.

  reply	other threads:[~2019-07-19 15:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 18:49 "btrfs: harden agaist duplicate fsid" spams syslog Graham Cobb
2019-07-11  2:46 ` Anand Jain
2019-07-11 18:00   ` Graham Cobb
2019-07-12 12:46     ` Anand Jain
2019-07-12 13:32       ` Graham Cobb
2019-07-19 15:38         ` David Sterba [this message]
2019-07-12 13:35       ` Patrik Lundquist
2019-07-12 13:41         ` Graham Cobb
2019-07-11 23:06   ` Christoph Anton Mitterer
2019-07-12 12:49     ` Anand Jain
2019-07-16 13:59 ` [PATCH] btrfs: ratelimit device path change info on mounted device Anand Jain
2019-07-16 14:08   ` Anand Jain
2019-07-19 14:58   ` 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=20190719153850.GM20977@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --cc=calestyo@scientia.net \
    --cc=g.btrfs@cobb.uk.net \
    --cc=linux-btrfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).