Bug 2224003

Summary: [RBD] rbd bench always open the image in both read and write mode
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Sunil Angadi <sangadi>
Component: RBDAssignee: Ilya Dryomov <idryomov>
Status: NEW --- QA Contact: Sunil Angadi <sangadi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1CC: ceph-eng-bugs, cephqe-warriors
Target Milestone: ---   
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Sunil Angadi 2023-07-19 14:23:23 UTC
Description of problem:
when a particular client set for read only mode for some images in pool
root@ceph-rbd1-s-r-avxinc-node2 ceph]# cat ceph.client.1.keyring
[client.1]
	key = AQAZyrdkk3HLMxAAa3qh2ThrWjF5Tmvugt6dWw==
	caps mon = "allow r"
	caps osd = "profile rbd-read-only pool=pool1 namespace=pool1_namespace"

rbd bench command open that image for both read and write mode which dis-obeys the capabilities set by the user


Version-Release number of selected component (if applicable):
[root@ceph-rbd1-s-r-avxinc-node2 ceph]# ceph -v
ceph version 17.2.6-98.el9cp (b53d9dfff6b1021fbab8e28f2b873d7d49cf5665) quincy (stable)

How reproducible:
Always

Steps to Reproduce:
1. Deploy rhcs 6.1 cluster.
2. create pool , create namespace and create images inside namespace.
3. create and set  client auth file with user caps as below 
[client.1]
	key = AQAZyrdkk3HLMxAAa3qh2ThrWjF5Tmvugt6dWw==
	caps mon = "allow r"
	caps osd = "profile rbd-read-only pool=pool1 namespace=pool1_namespace"

Actual results:
Able to access the image for both read and write mode using rbd bench command

Expected results:
Using rbd bench it should be able access the image what caps set by the user for that client.

Additional info:
Refer: https://tracker.ceph.com/issues/61383