Bug 862403 - lvmetad should not scan floppy
Summary: lvmetad should not scan floppy
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 13.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: Other openSUSE 13.1
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Liuhua Wang
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-05 17:24 UTC by Andrei Borzenkov
Modified: 2015-03-24 07:43 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
lvmdump (19.48 KB, application/x-compressed-tar)
2014-07-20 13:21 UTC, Andrei Borzenkov
Details
pvscan -vvv (7.10 KB, text/plain)
2014-07-20 14:47 UTC, Andrei Borzenkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Borzenkov 2014-02-05 17:24:39 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0

Patch for bnc#854413 switched LVM2 to use lvmetad by default. It appears lvmetad scans all available devices on startup, including CD-ROMs and floppy. It has cosmetic issues (errors are logged) but also attempt to access non-existent floppy is known to hang for very long time.

Currently patch is pulled back due to bnc#862076. If switch to lvmetad is considered again, it should restrict range of devices to scan, at least skip floppies.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Dong Mao Zhang 2014-03-24 05:19:20 UTC
Liuhua, Can you help to fix this?
Comment 2 Liuhua Wang 2014-04-08 09:00:10 UTC
(In reply to comment #0)
I have modified /etc/lvm/lvm.conf to fix the filter as followed:
-----------------------------------------
# By default we accept every block device except udev names, floppy and cdrom:
filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|","r|/dev/fd.*|", "r|/dev/cdrom|",  "a/.*/" ]
-----------------------------------------

Andrey: 
Would you please modify your filter in lvm.conf as the above and try again?

I have also committed to openSUSE:Factory/lvm2
Comment 3 Bernhard Wiedemann 2014-04-08 09:00:20 UTC
This is an autogenerated message for OBS integration:
This bug (862403) was mentioned in
https://build.opensuse.org/request/show/229351 13.1 / lvm2
Comment 4 Bernhard Wiedemann 2014-04-09 10:00:11 UTC
This is an autogenerated message for OBS integration:
This bug (862403) was mentioned in
https://build.opensuse.org/request/show/229469 Factory / lvm2
Comment 6 Matthias Griessmeier 2014-04-16 07:19:45 UTC
Update released for openSUSE 13.1 - resolved fixed.
Comment 7 Swamp Workflow Management 2014-04-16 08:04:52 UTC
openSUSE-RU-2014:0533-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 862403
CVE References: 
Sources used:
openSUSE 13.1 (src):    lvm2-2.02.98-0.28.18.1
Comment 8 Andrei Borzenkov 2014-04-19 15:12:05 UTC
This does not completely fix it. When the very first client connects to lvmetad, full device scan is triggered which still attempts to scan /dev/fd0 and /dev/cdrom. This device scan ignores device/filter setting. It does respect device/global_filter setting though and this was what originally was suggested.
Comment 9 Liuhua Wang 2014-06-25 09:24:43 UTC
Andrey, I am sorry there is some error with my bugzilla. it doesnot send mail to me. I just noticed the bug Reopened.

Can you tell what the reproduce steps? In my environment, I cannot see the log of scanning floppy disk.

Is the os installed on a lvm partition?
Comment 10 Andrei Borzenkov 2014-06-25 18:04:41 UTC
(In reply to comment #9)
> 
> Is the os installed on a lvm partition?

No. Here is trivial way to reproduce it

- install OS without LVM
- create the very first PV

this reliably triggers for me

[  143.704478] end_request: I/O error, dev fd0, sector 0
[  143.732256] end_request: I/O error, dev fd0, sector 0
Comment 11 Andrei Borzenkov 2014-06-25 18:14:37 UTC
Or the very first pvscan after reboot

linux-dwhw:~ # pvscan
  /dev/fd0: open failed: No such device or address
  /dev/cdrom: open failed: No medium found
Comment 12 Liuhua Wang 2014-06-26 09:01:39 UTC
Thanks for your reply.
I install newest sle12beta9, could not reproduce.

1. install sle12b9
2. edit /etc/lvm/lvm.conf :
   user_lvmetad = 1
3. systemctl enable lvm2-lvmetad.socket
   (if not enbale, lvmetad cannot run)
4. pvcreate /dev/sda3
5. pvscan
 pvscan return quickly.

Lvm2 has same source on sle12:GA and opensuse factory, so I tested with it.
Andey, would you please try on the newest os to see if still has this problem?
Comment 13 Andrei Borzenkov 2014-06-28 18:31:56 UTC
(In reply to comment #12)
> Lvm2 has same source on sle12:GA and opensuse factory, so I tested with it.
> Andey, would you please try on the newest os to see if still has this problem?

I installed Factory (network install) and lvmetad was disabled after installation. So of course this problem is not seen. I manually enabled lvmetad and I see the same problem.
Comment 14 Liuhua Wang 2014-07-02 10:14:54 UTC
Hi Andrey,

May I please you to give me some tar of lvmdump and output of pvscan -vvv?
Thanks very much.
Comment 15 Andrei Borzenkov 2014-07-20 13:21:49 UTC
Created attachment 599214 [details]
lvmdump
Comment 16 Andrei Borzenkov 2014-07-20 14:47:16 UTC
Created attachment 599215 [details]
pvscan -vvv

Files attached.
Comment 17 Liuhua Wang 2014-07-28 10:41:29 UTC
the pvscan result here has no prblem.
 # pvscan -vvv
      Setting activation/monitoring to 1
        Processing: pvscan -vvv
        O_DIRECT will be used
      Setting global/locking_type to 3
      Setting global/wait_for_locks to 1
      Cluster locking selected.
    connect() failed on local socket: No such file or directory
    Internal cluster locking initialisation failed.
      Setting global/fallback_to_local_locking to 1
      locking/fallback_to_local_locking not found in config: defaulting to 1
    WARNING: Falling back to local file-based locking.
    Volume Groups with the clustered attribute will be inaccessible.
      Setting global/locking_dir to /run/lvm/lock
      Setting global/prioritise_write_locks to 1
      Locking /run/lvm/lock/P_global WB
        _do_flock /run/lvm/lock/P_global:aux WB
        _do_flock /run/lvm/lock/P_global WB
        _undo_flock /run/lvm/lock/P_global:aux
    Wiping cache of LVM-capable devices
        /dev/vda: Added to device cache
        /dev/vda1: Added to device cache
        /dev/disk/by-uuid/ac22fbb1-3206-44c9-9094-effef5836834: Aliased to /dev/vda1 in device cache
        /dev/vda2: Added to device cache
        /dev/disk/by-uuid/9aaec23b-2b85-4caa-840e-c0cd36a79ecf: Aliased to /dev/vda2 in device cache
        /dev/root: Aliased to /dev/vda2 in device cache (preferred name)
        /dev/vda3: Added to device cache
        /dev/disk/by-uuid/124a1883-eb38-4df2-b2c2-347dc8ff5ef1: Aliased to /dev/vda3 in device cache
        /dev/fd0: Added to device cache
    Wiping internal VG cache
        lvmcache: initialised VG #orphans_lvm1
        lvmcache: initialised VG #orphans_pool
        lvmcache: initialised VG #orphans_lvm2
      Setting response to OK
      Setting response to OK
    Walking through all physical volumes
      Setting response to OK
      Setting response to OK
    No matching physical volumes found
      Unlocking /run/lvm/lock/P_global
        _undo_flock /run/lvm/lock/P_global
----------------------------------------

Is that your fd0 device is not in good status?
Can you open it manually?
Comment 18 Lidong Zhong 2014-12-19 07:15:35 UTC
Hi,
When use_lvmetad is set, the filter only works when the global_filter in devices section is set. Please add "r|/dev/fd.*|" and do the test again.

But the root problem is not here. It's:
 59       Setting response to token_mismatch
 60       Setting response to OK

The result of first reply from lvmetad is "token_mismatch" instead of "OK", and followed by a lot of "Unknown". However, I can't reproduce this locally. So would you mind let me take a look at your test machines?
Comment 19 Liuhua Wang 2015-03-24 07:43:44 UTC
modify /etc/lvm/lvm.conf to umcomment global_filter as the followed:

  global_filter = ["r|/dev/fd.*|", "a/.*/"]

should prevent lvmetad from scanning floppy disk.And we had a test to show that works.

Close this bug.