Bug 1001120 - blkid & wipefs need bcache support
Summary: blkid & wipefs need bcache support
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 998543 1008227 1008228
TreeView+ depends on / blocked
Reported: 2013-08-26 14:15 UTC by Rolf Fokkens
Modified: 2013-09-30 00:43 UTC (History)
4 users (show)

Fixed In Version: util-linux-2.24-0.1.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-09-30 00:43:54 UTC
Type: Bug

Attachments (Terms of Use)
Patch to make blkid / wipefs identfy bcache superblocks (10.92 KB, patch)
2013-08-31 19:26 UTC, Rolf Fokkens
no flags Details | Diff
Patch to make blkid / wipefs identfy bcache superblocks (V2) (10.99 KB, patch)
2013-09-01 21:52 UTC, Rolf Fokkens
no flags Details | Diff

Description Rolf Fokkens 2013-08-26 14:15:51 UTC
Description of problem: To achieve bcache support in Fedora 20 (See bugs 998543 and 998543) blkid may need to be able to identify bcache superblocks. Currently there is a workaround because bcache-tools provides the probe-bcache utility, but having blkid identify bcache blocks itself may be more appropriate.

So I'm not sure if this really needs addressing, but filing a bug anyway.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run blkid on a bcache device e.g. blkid /dev/sdb3
2. Not that blkid does not identify the device

Actual results:
Not identified

Expected results:
Identified accurately

Additional info:
If it is agreed that this needs to be resolved, I'd be more than willing to build a patch that takes care of it.

Comment 1 Rolf Fokkens 2013-08-27 06:31:14 UTC
Added wipefs to the bug title, since it needs changing as well.

Comment 2 Karel Zak 2013-08-27 11:12:33 UTC
No problem to add bcache probing function o libblkid.

Comment 3 Rolf Fokkens 2013-08-27 11:37:01 UTC
OK, I'll build patches for this. Probably next weekend.

Comment 4 Karel Zak 2013-08-29 07:32:06 UTC
(In reply to Rolf Fokkens from comment #3)
> OK, I'll build patches for this. Probably next weekend.

Please, use try to check more things than only the magic string to make the prober more robust. For example also csum and offset from the cache_sb. Thanks.

Comment 5 Rolf Fokkens 2013-08-31 19:26:05 UTC
Created attachment 792459 [details]
Patch to make blkid / wipefs identfy bcache superblocks

Comment 6 Rolf Fokkens 2013-08-31 19:32:49 UTC
As requested the magic string, the csum and the offset are used to identify bcache supperblocks.

Reported with upstream bcache:


Comment 7 Nimimo 2013-08-31 19:54:02 UTC

I had an incomplete wip doing that, with:
a #define for BLKID_USAGE_CACHE, a call to blkid_probe_sprintf_version, and a check of the sb->offset field.
The set_uuid might also be useful to expose, not sure if there's already a libblkid property name for those.

Comment 8 Karel Zak 2013-09-01 18:54:02 UTC
I have a question -- is there a minimal size of the device required for the bcache? We use blkid_idinfo->minsz to avoid unnecessary seeks+read on too small devices.

And.. it would be nice to have a test image (just dd(1)) with bcache superblock. I'd like to add the image to upstream regression test suite. (gzip.. and send me the image by email:-) 


Comment 9 Nimimo 2013-09-01 19:39:05 UTC
A backing device is at least 8k, and (assuming 4k pages) so is a cache device.

I'm not sure the crc check should be done here, it would be good if wipefs could wipe superblocks with bad crcs.

Comment 10 Rolf Fokkens 2013-09-01 21:24:10 UTC
Sent you the image by mail.

Something I noted: apparently the minimum image size is 2MB. When smaller blkid will not identify the image. Is this correct behaviour?

Comment 11 Rolf Fokkens 2013-09-01 21:52:06 UTC
Created attachment 792676 [details]
Patch to make blkid / wipefs identfy bcache superblocks (V2)

Created a new patch to make blkid / wipefs identfy bcache superblocks. Changes:
- actually does check the position specified in the superblock
- minsz is now set at 8192

Comment 12 Rolf Fokkens 2013-09-02 21:15:13 UTC
This 'Bug' relates to other Bugs as well because it may obsolete probe-bcache (Bugs 999690, 1003207).

Do you think this Bug will be processed in the F20 util-linux package?

Comment 13 Karel Zak 2013-09-03 09:14:35 UTC
(In reply to Rolf Fokkens from comment #12)
> Do you think this Bug will be processed in the F20 util-linux package?

Yes, I'm going to add bcache support to v2.24 (rc in Sep, final release in Oct -- rc will be in F20).

Comment 14 Karel Zak 2013-09-11 15:52:59 UTC
Merged to the upstream tree. Thanks!

Comment 15 Fedora Update System 2013-09-27 13:28:36 UTC
util-linux-2.24-0.1.fc20 has been submitted as an update for Fedora 20.

Comment 16 Fedora Update System 2013-09-28 00:17:00 UTC
Package util-linux-2.24-0.1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing util-linux-2.24-0.1.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 17 Fedora Update System 2013-09-30 00:43:54 UTC
util-linux-2.24-0.1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.