All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: Gang He <ghe@suse.com>, Zdenek Kabelac <zkabelac@redhat.com>
Cc: linux-lvm@redhat.com
Subject: Re: [linux-lvm] pvscan: /dev/sdc: open failed: No medium found
Date: Wed, 24 Apr 2019 10:35:33 -0500	[thread overview]
Message-ID: <20190424153533.GB3218@redhat.com> (raw)
In-Reply-To: <a68614d8-6efe-b00a-e40b-210235a58ad7@redhat.com>

On Wed, Apr 24, 2019 at 10:37:26AM +0200, Zdenek Kabelac wrote:
> Dne 23. 04. 19 v 16:27 David Teigland napsal(a):
> > On Mon, Apr 22, 2019 at 11:15:53PM -0600, Gang He wrote:
> > > Hello List,
> > > 
> > > One user complained this error message.
> > > The user has a usb sd card reader with no media present.  When they issue a pvscan under lvm2-2.02.180 the device is opened which results in 'No medium found' being reported.
> > > But lvm2-2.02.120 did not do this (the device appears to get filtered out earlier). The customer views the 'No medium found' message as an issue/bug.
> > > Any suggest/comments for this error message?
> > > 
> > > The detailed information is as below,
> > > lvm2 2.02.180-9.4.2
> > > OS: SLES12 SP4
> > > Kernel 4.12.14-95.3-default
> > > Hardware: HP ProLiant DL380 Gen10
> > > 
> > > After upgrade from sles12SP3 to SP4, customer is reporting the following error message:
> > > 
> > >   # pvscan
> > >   /dev/sdc: open failed: No medium found
> > >   PV /dev/sdb   VG Q11vg10         lvm2 [5.24 TiB / 2.00 TiB free]
> > >   Total: 1 [5.24 TiB] / in use: 1 [5.24 TiB] / in no VG: 0 [0   ]
> > 
> > I've heard this a few times now, I guess we should drop it, it's probably
> > more trouble than help.
> > 
> 
> This hotfix patch:
> 
> https://www.redhat.com/archives/lvm-devel/2019-April/msg00067.html
> 
> is unfortunately faulty and should be reverted.
> 
> The core problem is - the filtering layer is somehow bypassed where cdrom
> used be recognized as unsuitable device for opening.
>
> So the error reported by lvm2 is really an error where lvm2 should not be
> trying to even open such device.

I don't believe opening is the problem; most filters need the device open.
I suspect the difference is that filter-usable once used
dev_open_readonly_quiet itself, which suppressed the warning, to use with
dev_get_size.  Now the filter relies on dev_get_size to open the dev if
necessary (it's often already open), and that does not use the quiet flag.

This might be an effective alternative to suppressing all open warnings
(I can't say for certain in this case until seeing which open triggered
the warning.)

diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index 3fe264755443..bd6cbcb04a1b 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -165,7 +165,7 @@ static int _dev_get_size_dev(struct device *dev, uint64_t *size)
        }
 
        if (fd <= 0) {
-               if (!dev_open_readonly(dev))
+               if (!dev_open_readonly_quiet(dev))
                        return_0;
                fd = dev_fd(dev);
                do_close = 1;

  reply	other threads:[~2019-04-24 15:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23  5:15 [linux-lvm] pvscan: /dev/sdc: open failed: No medium found Gang He
2019-04-23 14:27 ` David Teigland
2019-04-24  8:37   ` Zdenek Kabelac
2019-04-24 15:35     ` David Teigland [this message]
2019-04-24 19:43       ` Zdenek Kabelac
2019-04-23 15:24 ` Peter Rajnoha
2019-04-24  3:23   ` Gang He
     [not found]     ` <20190424150858.GA3218@redhat.com>
2019-04-29  9:16       ` Gang He

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=20190424153533.GB3218@redhat.com \
    --to=teigland@redhat.com \
    --cc=ghe@suse.com \
    --cc=linux-lvm@redhat.com \
    --cc=zkabelac@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.