linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user
@ 2020-07-20 11:02 heming.zhao
  2020-07-20 17:54 ` David Teigland
  0 siblings, 1 reply; 6+ messages in thread
From: heming.zhao @ 2020-07-20 11:02 UTC (permalink / raw)
  To: linux-lvm

Hello list,

first, I give a example, if a disk (/dev/sdb) has md metadata info. the pvcreate cmd will be failed and show info:
```
# pvcreate /dev/sdb
Device /dev/sdb excluded by a filter
```

For developer, if he wants to know the reason, he may execute below command:
```
# pvcreate -vvvv -ddddd 2>&1 /dev/sdb | grep filter | grep sdb
17:55:50.87938 pvcreate[15739] filters/filter-partitioned.c:31 filter partitioned deferred /dev/sdb
17:55:50.87964 pvcreate[15739] filters/filter-signature.c:32 filter signature deferred /dev/sdb
17:55:50.87982 pvcreate[15739] filters/filter-md.c:101 filter md deferred /dev/sdb
17:55:50.87999 pvcreate[15739] filters/filter-persistent.c:125 filter cache deferred /dev/sdb
17:55:50.99973 pvcreate[15739] label/label.c:377 Scan filtering /dev/sdb
17:55:50.101008 pvcreate[15739] filters/filter-md.c:109 md filter full 1 excluding md component /dev/sdb
17:55:50.101022 pvcreate[15739] filters/filter-md.c:111 /dev/sdb: Skipping md component device
17:55:50.101028 pvcreate[15739] filters/filter-persistent.c:134 filter caching bad /dev/sdb
17:55:50.101035 pvcreate[15739] label/label.c:389 /dev/sdb: Not processing filtered
17:55:50.104423 pvcreate[15739] filters/filter-persistent.c:94 /dev/sdb: filter cache skipping (cached bad)
17:55:50.104478 pvcreate[15739] filters/filter-persistent.c:94 /dev/sdb: filter cache skipping (cached bad)
17:55:50.104600 pvcreate[15739] toollib.c:5459 Device /dev/sdb excluded by a filter.
```

from above info, there is a key output:
```
filters/filter-md.c:109 md filter full 1 excluding md component /dev/sdb
```
It will help developer to locate the rootcause: it's not issue/error, /dev/sdb just a md dev. pvcreate doesn't work because there has md metadata.

But these info is mystical & unclear for end user, who only knows there is a filter config in /etc/lvm/lvm.conf. And the end user has no clue what's going on. The end user is expecting some likely useful clue at the first place.

So, in my opinion, I suggest there should be some code improvement for all filter failed info. Some filter failed debug log should convert from debug level to standard output level.

For this pvcreate example, If pvcreate print some thing like, for example, "/dev/sdb" might be has md meta data, and refuse to continue, bla bla, ... It's more readable.

Thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user
  2020-07-20 11:02 [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user heming.zhao
@ 2020-07-20 17:54 ` David Teigland
  2020-07-21  8:37   ` heming.zhao
  2020-10-15 15:05   ` heming.zhao
  0 siblings, 2 replies; 6+ messages in thread
From: David Teigland @ 2020-07-20 17:54 UTC (permalink / raw)
  To: heming.zhao; +Cc: linux-lvm

On Mon, Jul 20, 2020 at 07:02:15PM +0800, heming.zhao@suse.com wrote:
> So, in my opinion, I suggest there should be some code improvement for
> all filter failed info. Some filter failed debug log should convert from
> debug level to standard output level.

Yes, that's long standing annoyance, and it's simple to fix.  Added that
in the branch below, but it needs some tests, and it should probably be
used in some more places.
https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/heads/dev-dct-filter-reason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user
  2020-07-20 17:54 ` David Teigland
@ 2020-07-21  8:37   ` heming.zhao
  2020-10-15 15:05   ` heming.zhao
  1 sibling, 0 replies; 6+ messages in thread
From: heming.zhao @ 2020-07-21  8:37 UTC (permalink / raw)
  To: David Teigland; +Cc: linux-lvm

Thank you for your quickly fix.

On 7/21/20 1:54 AM, David Teigland wrote:
> On Mon, Jul 20, 2020 at 07:02:15PM +0800, heming.zhao@suse.com wrote:
>> So, in my opinion, I suggest there should be some code improvement for
>> all filter failed info. Some filter failed debug log should convert from
>> debug level to standard output level.
> 
> Yes, that's long standing annoyance, and it's simple to fix.  Added that
> in the branch below, but it needs some tests, and it should probably be
> used in some more places.
> https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/heads/dev-dct-filter-reason
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user
  2020-07-20 17:54 ` David Teigland
  2020-07-21  8:37   ` heming.zhao
@ 2020-10-15 15:05   ` heming.zhao
  2020-10-15 15:16     ` David Teigland
  1 sibling, 1 reply; 6+ messages in thread
From: heming.zhao @ 2020-10-15 15:05 UTC (permalink / raw)
  To: David Teigland; +Cc: linux-lvm

Hello David,

I don't know why I could use "git show 1fa48ba9d60ad34c5957b80024ef660ffb11161f" to 
see your patch, but I can't find the commit in "git log" output (in master branch).
And the related code also doesn't be changed in master branch.

Thanks.

On 7/21/20 1:54 AM, David Teigland wrote:
> On Mon, Jul 20, 2020 at 07:02:15PM +0800, heming.zhao@suse.com wrote:
>> So, in my opinion, I suggest there should be some code improvement for
>> all filter failed info. Some filter failed debug log should convert from
>> debug level to standard output level.
> 
> Yes, that's long standing annoyance, and it's simple to fix.  Added that
> in the branch below, but it needs some tests, and it should probably be
> used in some more places.
> https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/heads/dev-dct-filter-reason
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user
  2020-10-15 15:05   ` heming.zhao
@ 2020-10-15 15:16     ` David Teigland
  2020-10-15 15:40       ` heming.zhao
  0 siblings, 1 reply; 6+ messages in thread
From: David Teigland @ 2020-10-15 15:16 UTC (permalink / raw)
  To: heming.zhao; +Cc: linux-lvm

On Thu, Oct 15, 2020 at 11:05:38PM +0800, heming.zhao@suse.com wrote:
> Hello David,
> 
> I don't know why I could use "git show 1fa48ba9d60ad34c5957b80024ef660ffb11161f" to 
> see your patch, but I can't find the commit in "git log" output (in master branch).
> And the related code also doesn't be changed in master branch.

See these commits in the master branch:
450f272b31ef95bd7cb61812d9ef0525c7c1c341
74ed6e8a9969bb7d20c21f88b53e6134d81eab1d
0143c7aebe2389ceada6ca0a314a3ff0fd9cdfef

(The link I sent previously wasn't merged.)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user
  2020-10-15 15:16     ` David Teigland
@ 2020-10-15 15:40       ` heming.zhao
  0 siblings, 0 replies; 6+ messages in thread
From: heming.zhao @ 2020-10-15 15:40 UTC (permalink / raw)
  To: David Teigland; +Cc: linux-lvm

I just built & ran tag 2.3.10 code, the behavior like before.
(looks it should output: "device has a signature")
```
[tb-clustermd1 ~]# dd if=/dev/zero of=/dev/vdb bs=1M
dd: error writing '/dev/vdb': No space left on device
101+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0600205 s, 1.7 GB/s
[tb-clustermd1 ~]# dd if=/dev/zero of=/dev/vdc bs=1M
dd: error writing '/dev/vdc': No space left on device
101+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0566928 s, 1.8 GB/s
[tb-clustermd1 ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0   40G  0 disk 
├─vda1 253:1    0    8M  0 part 
├─vda2 253:2    0   38G  0 part /
└─vda3 253:3    0    2G  0 part [SWAP]
vdb    253:16   0  100M  0 disk 
vdc    253:32   0  100M  0 disk 
[tb-clustermd1 ~]# parted -s /dev/vdb mklabel gpt
[tb-clustermd1 ~]# parted -s /dev/vdb mkpart parimary 0% 100%
Warning: The resulting partition is not properly aligned for best performance: 34s % 2048s != 0s
[tb-clustermd1 ~]# mkfs.ext4 /dev/vdb1 
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 102364 1k blocks and 25688 inodes
Filesystem UUID: 56f60edd-a235-460b-b868-3c3d1b5e4e01
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

[tb-clustermd1 ~]# parted -s /dev/vdb rm 1
[tb-clustermd1 ~]# vgcreate testvg /dev/vdc /dev/vdb
  Device /dev/vdb excluded by a filter.
```


btw, I just built & ran latest master branch code, I saw lots of logs, it looks the code buggy/unstable.
```
# ./tools/lvm vgcreate testvg /dev/vdc /dev/vdb
  Device open /dev/sda already open with di -8193 fd -1
  Device open /dev/vda already open with di -8193 fd -1
  Device open /dev/vda1 already open with di -8193 fd -1
  Device open /dev/vda2 already open with di -8193 fd -1
  Device open /dev/vda3 already open with di -8193 fd -1
  Device open /dev/sdb already open with di -8193 fd -1
  Device open /dev/vdb already open with di -8193 fd -1
  Device open /dev/sdc already open with di -8193 fd -1
  Device open /dev/vdc already open with di -8193 fd -1
  Device open /dev/sdd already open with di -8193 fd -1
  Device open /dev/sde already open with di -8193 fd -1
  Device open /dev/sdf already open with di -8193 fd -1
  Device open /dev/sda already open with di -8193 fd -1
  Device open /dev/vda already open with di -8193 fd -1
  Device open /dev/vda1 already open with di -8193 fd -1
  Device open /dev/vda2 already open with di -8193 fd -1
  Device open /dev/vda3 already open with di -8193 fd -1
  Device open /dev/sdb already open with di -8193 fd -1
  Device open /dev/vdb already open with di -8193 fd -1
  Device open /dev/sdc already open with di -8193 fd -1
  Device open /dev/vdc already open with di -8193 fd -1
  Device open /dev/sdd already open with di -8193 fd -1
  Device open /dev/sde already open with di -8193 fd -1
  Device open /dev/sdf already open with di -8193 fd -1
  Device open /dev/vdc already open with di -8193 fd -1
  Device open /dev/vdc already open with di -8193 fd -1
  Device open /dev/vdb already open with di -8193 fd -1
  Device open /dev/vdb already open with di -8193 fd -1
  Device open /dev/vdc already open with di -8193 fd -1
  Device open /dev/vdb already open with di -8193 fd -1
  Device open /dev/vdc already open with di -8193 fd -1
  Device open /dev/vdb already open with di -8193 fd -1
```

On 10/15/20 11:16 PM, David Teigland wrote:
> On Thu, Oct 15, 2020 at 11:05:38PM +0800, heming.zhao@suse.com wrote:
>> Hello David,
>>
>> I don't know why I could use "git show 1fa48ba9d60ad34c5957b80024ef660ffb11161f" to
>> see your patch, but I can't find the commit in "git log" output (in master branch).
>> And the related code also doesn't be changed in master branch.
> 
> See these commits in the master branch:
> 450f272b31ef95bd7cb61812d9ef0525c7c1c341
> 74ed6e8a9969bb7d20c21f88b53e6134d81eab1d
> 0143c7aebe2389ceada6ca0a314a3ff0fd9cdfef
> 
> (The link I sent previously wasn't merged.)
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-15 15:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 11:02 [linux-lvm] Suggestion: lvm2 filters lib needs to show some readable info for end user heming.zhao
2020-07-20 17:54 ` David Teigland
2020-07-21  8:37   ` heming.zhao
2020-10-15 15:05   ` heming.zhao
2020-10-15 15:16     ` David Teigland
2020-10-15 15:40       ` heming.zhao

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).