Skip to content

librbd: should not permit update image metadata via snapshot - #37417

Merged
dillaman merged 1 commit into
ceph:masterfrom
Songweibin:wip-rbd-metadata-update
Sep 28, 2020
Merged

dillaman merged 1 commit into
ceph:masterfrom
Songweibin:wip-rbd-metadata-update

Conversation

@Songweibin

Copy link
Copy Markdown
Contributor

Fixes: #37121
As discussed in #37121 (comment)

Signed-off-by: songweibin [email protected]

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@dillaman

Copy link
Copy Markdown

@Songweibin unit tests are failing

@Songweibin
Songweibin force-pushed the wip-rbd-metadata-update branch from 4ca4001 to 36bf797 Compare September 26, 2020 11:13
@Songweibin

Copy link
Copy Markdown
Contributor Author

Fixed, thanks.

@dillaman dillaman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dillaman
dillaman merged commit fd15995 into ceph:master Sep 28, 2020
@Songweibin
Songweibin deleted the wip-rbd-metadata-update branch September 29, 2020 11:54
Songweibin added a commit to ceph/ceph-ci that referenced this pull request Nov 28, 2020
In iSCSI scenario (via tcmu-runner), after a client has acquired exclusive
lock on an image, users will no longer be able to set metadata on the image.
This commit try to fix it by forward the request to the lock owner.

Steps to reproduce:

1. Client A:
```
>>> import rbd, rados;client=rados.Rados(conffile='');client.connect();ioctx=client.open_ioctx('rbd');rbd_inst=rbd.RBD();image=rbd.Image(ioctx, 'img1')
>>> from rbd import RBD_LOCK_MODE_EXCLUSIVE
>>> image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
>>>
```

2. Client B:
```
$ rbd image-meta set img1 conf_rbd_qos_iops_limit 10000
2020-09-12T15:19:58.325+0800 7f161affd700 -1 librbd::ManagedLock: 0x7f15f4001d48 handle_acquire_lock: failed to acquire exclusive lock:(30) Read-only file system
failed to set metadata conf_rbd_qos_iops_limit of image : (30) Read-only file system
rbd: setting metadata failed: (30) Read-only file system
$
```

Signed-off-by: songweibin <[email protected]>
(cherry picked from commit 7bc663d)
(cherry picked from commit ceph/ceph#37121
                       and ceph/ceph#37417)
Signed-off-by: songweibin <[email protected]>

Change-Id: I82c615cb65c3a604f7ef955d83a011717fc02413
Songweibin added a commit to ceph/ceph-ci that referenced this pull request Apr 22, 2021
In iSCSI scenario (via tcmu-runner), after a client has acquired exclusive
lock on an image, users will no longer be able to set metadata on the image.
This commit try to fix it by forward the request to the lock owner.

Steps to reproduce:

1. Client A:
```
>>> import rbd, rados;client=rados.Rados(conffile='');client.connect();ioctx=client.open_ioctx('rbd');rbd_inst=rbd.RBD();image=rbd.Image(ioctx, 'img1')
>>> from rbd import RBD_LOCK_MODE_EXCLUSIVE
>>> image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
>>>
```

2. Client B:
```
$ rbd image-meta set img1 conf_rbd_qos_iops_limit 10000
2020-09-12T15:19:58.325+0800 7f161affd700 -1 librbd::ManagedLock: 0x7f15f4001d48 handle_acquire_lock: failed to acquire exclusive lock:(30) Read-only file system
failed to set metadata conf_rbd_qos_iops_limit of image : (30) Read-only file system
rbd: setting metadata failed: (30) Read-only file system
$
```

Signed-off-by: songweibin <[email protected]>
(cherry picked from commit 7bc663d)
(cherry picked from commit ceph/ceph#37121
                       and ceph/ceph#37417)
Signed-off-by: songweibin <[email protected]>

Change-Id: I82c615cb65c3a604f7ef955d83a011717fc02413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants