Bug 832069

Summary: [Regression] blkid -g has no effect on RHEL6
Product: Red Hat Enterprise Linux 6 Reporter: Martin Kyral <mkyral>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2Keywords: Regression
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 833732 (view as bug list) Environment:
Last Closed: 2012-06-25 12:07:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Kyral 2012-06-14 12:44:42 UTC
Description of problem:
blkid -g shall clean the removed block devices from the cache (/etc/blkid/blkid.tab). However, on RHEL6 invoking blkid -g on system having removed devices in the cache has no effect ($? is 0). The bug was verified with both loop device and real partition.

Version-Release number of selected component (if applicable):
util-linux-ng-2.17.2-12.4.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. dd if=/dev/zero of=/tmp/blkidloop bs=1024 count=1000
2. yes | mke2fs -T ext3 -L blkidloop -b 1024 /tmp/blkidloop
3. blkid /tmp/blkidloop
4. rm -f /tmp/blkidloop
5. blkid -g
6. grep blkidloop /etc/blkid/blkid.tab
  
Actual results:
A record similar to this is found:
<device DEVNO="0x0000" TIME="1339677331.186635" LABEL="blkidloop" UUID="ff340cb5-dc07-402f-bd7c-1c239a166dfb" TYPE="ext2">/tmp/blkidloop</device>

Expected results:
No record is found

Additional info:
Running blkid without any parameter removes the invalid entry from the cache and prints the cache contents so it can be used as a workaround.

Comment 3 Karel Zak 2012-06-25 12:07:31 UTC
- regression against what? .. the current behavior is pretty old
(since e2fsprogs > v1.41.4, commit fe144e11 in e2fsprogs tree and commit
1de91705 in util-linux tree)

- the -g options is there for backward compatibility only than 
for anything useful
 
- blkid.tab is *private* libblkid cache file, it's not API. The file and
arbitrary functionality around the file maybe changed.

Comment 4 Martin Kyral 2012-06-25 12:30:56 UTC
Regression against RHEL5, where the feature was introduced (and is working): https://bugzilla.redhat.com/show_bug.cgi?id=563909

If the feature have no use anymore and is present for backward compatibility only, it shall be at least stated in the documentation. Now the man page says: "-g     Perform a garbage collection pass on the blkid cache to remove devices which no longer exist."