Project

General

Profile

Actions

Bug #50234

closed

krbd failed to mount after map image with read-only option

Added by Son Hai Ha about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
krbd
Crash signature (v1):
Crash signature (v2):

Description

Context

- Using admin keyring
- Linux Kernel: 3.10.0-1160.15.2.el7.x86_64
- Linux Distribution: Red Hat Enterprise Linux Server 7.8 (Maipo)
- Ceph version: "ceph version 14.2.8 (2d095e947a02261ce61424021bb43bd3022d35cb) nautilus (stable)"

rbd image 'csi-vol-85919409-9797-11eb-80ba-720b2b57c790':
        size 10 GiB in 2560 objects
        order 22 (4 MiB objects)
        snapshot_count: 0
        id: 533a03bba388ea
        block_name_prefix: rbd_data.533a03bba388ea
        format: 2
        features: layering
        op_features:
        flags:
        create_timestamp: Wed Apr  7 13:51:02 2021
        access_timestamp: Wed Apr  7 13:51:02 2021
        modify_timestamp: Wed Apr  7 13:51:02 2021

Bug reproduce

Map RBD image WITH read-only option, CANNOT mount with both readonly or readwrite option

$> sudo rbd device map -p k8s-sharedpool csi-vol-85919409-9797-11eb-80ba-720b2b57c790 -ro
  /dev/rbd0

$> sudo mount -v -r -t ext4 /dev/rbd0 /mnt/test1
  mount: cannot mount /dev/rbd0 read-only

$> sudo mount -v -r -t ext4 /dev/rbd0 /mnt/test1
  mount: /dev/rbd0 is write-protected, mounting read-only
  mount: cannot mount /dev/rbd0 read-only

Map RBD image WITHOUT read-only option, CAN mount with both readonly or readwrite option

$> sudo rbd device map -p k8s-sharedpool csi-vol-85919409-9797-11eb-80ba-720b2b57c790
  /dev/rbd0

$> sudo mount -v -r -t ext4 /dev/rbd0 /mnt/test1
  mount: /mnt/test1 does not contain SELinux labels.
       You just mounted an file system that supports labels which does not
       contain labels, onto an SELinux box. It is likely that confined
       applications will generate AVC messages and not be allowed access to
       this file system.  For more details see restorecon(8) and mount(8).
  mount: /dev/rbd0 mounted on /mnt/test1.

$> sudo mount -v -t ext4 /dev/rbd0 /mnt/test1
  mount: /mnt/test1 does not contain SELinux labels.
       You just mounted an file system that supports labels which does not
       contain labels, onto an SELinux box. It is likely that confined
       applications will generate AVC messages and not be allowed access to
       this file system.  For more details see restorecon(8) and mount(8).
  mount: /dev/rbd0 mounted on /mnt/test1.

Expectated result

Linux can mount with option "read-only" for rbd image that are mapped with "read-only" option

Actions #1

Updated by Ilya Dryomov about 3 years ago

  • Project changed from Ceph to Linux kernel client
Actions #3

Updated by Ilya Dryomov almost 3 years ago

ext4 will always try to recover it's journal during mount and this means 
it wants to write. That fails.

Try this with mounting:

sudo mount -t ext4 -o norecover /dev/rbd0 /mnt/test1

or

sudo mount -t ext4 -o noload /dev/rbd0 /mnt/test1

Thank you. The option "noload" works as expected.
Actions #4

Updated by Ilya Dryomov almost 3 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF