bcache-super-show segfaults reading superblock on dasd

Bug #1821353 reported by Ryan Harper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Invalid
High
bugproxy
bcache-tools (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

1. # lsb_release -rd
Description: Ubuntu Disco Dingo (development branch)
Release: 19.04

2. # apt-cache policy bcache-tools
bcache-tools:
  Installed: 1.0.8-3
  Candidate: 1.0.8-3
  Version table:
 *** 1.0.8-3 500
        500 http://us.ports.ubuntu.com/ubuntu-ports disco/main s390x Packages
        100 /var/lib/dpkg/status

3. bcache-super-show /dev/dasda

Should return the superblock information on the device.

4. segfaults.

Reproduce with:

$ ls -al /dev/disk/by-path/ccw-0.0.1520
lrwxrwxrwx 1 root root 11 Mar 22 08:34 /dev/disk/by-path/ccw-0.0.1520 -> ../../dasda
$ make-bcache --writeback --cache /dev/disk/by-path/ccw-0.0.1520
$ bcache-super-show /dev/disk/by-path/ccw-0.0.1520

ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: bcache-tools 1.0.8-3
ProcVersionSignature: Ubuntu 4.18.0-15.16-generic 4.18.20
Uname: Linux 4.18.0-15-generic s390x
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.10-0ubuntu21
Architecture: s390x
Date: Fri Mar 22 08:38:06 2019
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: bcache-tools
UpgradeStatus: Upgraded to disco on 2019-02-18 (31 days ago)

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Requesting reverse proxy to ibm for attention

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
importance: Undecided → High
assignee: nobody → bugproxy (bugproxy)
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2019-03-25 04:49 EDT-------
Description will be reversed mirrored from LP

tags: added: architecture-s39064 bugnameltc-176335 severity-high targetmilestone-inin1904
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2019-03-25 05:32 EDT-------
This error is likely due to using the full block device node (dasda) instead of a partition device node (e.g. dasda1) of a CDL formatted DASD device.

Note that the first two tracks (1 track = 48k at 4k block size) of a CDL-formatted DASD device have special properties. Not all data written to these blocks is retained. Instead portions of the data are replaced by an E5 byte pattern. Applications/FS should therefore not use the block device, but only partition devices.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Can you attach a core dump?

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@Peter
I guess the question is, whether or not, we should be trying to use dasd as a bcache device at all. Or like create a partition table, and use the partition as a bcache device then? In that case should the make-bcache fail on the full dasd device, as shows in the reproducer steps?

If I understand correctly where the request is coming from, MAAS/NewServerInstaller use curtin which supports bcache setup, and that fails with dasd drives at the moment in curtin's implementation / integration test suite.

Revision history for this message
Ryan Harper (raharper) wrote :

There are no restrictions on non-dasd devices so we can update curtin to ensure that we don't allow creating bcache devices on dasd without a partition.

I'm not sure whether or not it's worth adding dasd specific checks to bcache-tools to refuse when supplied with a dasd block device.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2019-04-02 04:03 EDT-------
(In reply to comment #12)
> @Peter
> I guess the question is, whether or not, we should be trying to use dasd as
> a bcache device at all.

In my opinion completely preventing the use of DASD for bcache would be overly restrictive.

> Or like create a partition table, and use the
> partition as a bcache device then? In that case should the make-bcache fail
> on the full dasd device, as shows in the reproducer steps?

Creating a partition and using the partition as bcache device is the recommended approach. I don't think that workarounds for DASD particularities would fit into bcache-tools though.

> If I understand correctly where the request is coming from,
> MAAS/NewServerInstaller use curtin which supports bcache setup, and that
> fails with dasd drives at the moment in curtin's implementation /
> integration test suite.

I'm not familiar with curtin, but if that's a layer on top that makes use of bcache-tools, then that may be a good place to catch/prevent the attempt to run bcache on the DASD block device and to suggest using a partition instead.

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: New → Triaged
Revision history for this message
Ryan Harper (raharper) wrote :

Marking this invalid since DASDs can't be used directly without a partition table.

Changed in bcache-tools (Ubuntu):
status: New → Invalid
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Triaged → Invalid
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2019-05-29 03:46 EDT-------
IBM bugzilla status -> closed, set to Invalid by Canonical

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.