Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librbd: do not raise an error if trash list returns -ENOENT #15085

Merged
merged 2 commits into from May 18, 2017

Conversation

Projects
None yet
2 participants
@runsisi
Copy link
Contributor

runsisi commented May 15, 2017

otherwise the python iterator class TrashIterator will thow an excepiton if no image is in the trash bin

Signed-off-by: runsisi runsisi@zte.com.cn

@runsisi

This comment has been minimized.

Copy link
Contributor Author

runsisi commented May 15, 2017

@dillaman i am not sure why we have a self.num_entries = 1024 (https://github.com/ceph/ceph/blob/master/src/pybind/rbd/rbd.pyx#L2907) limit on trash list, is it expected? thanks!

@@ -2340,6 +2340,11 @@ extern "C" int rbd_trash_list(rados_ioctx_t p, rbd_trash_image_info_t *entries,

vector<librbd::trash_image_info_t> cpp_entries;
int r = librbd::trash_list(io_ctx, cpp_entries);
if (r == -ENOENT) {

This comment has been minimized.

Copy link
@dillaman

dillaman May 15, 2017

Contributor

This only changes the behavior for the C API -- so it is leaving the C++ API inconsistent. It would probably be better to make a change like this within trash_list in internal.cc

This comment has been minimized.

Copy link
@runsisi

runsisi May 15, 2017

Author Contributor

OK, i will address it, and all other list apis, e.g., RBD::list, RBD::group_list, etc.

@dillaman

This comment has been minimized.

Copy link
Contributor

dillaman commented May 15, 2017

@runsisi It's just used for the memory allocation tracking. You will see that pattern all over rbd.pyx.

@runsisi

This comment has been minimized.

Copy link
Contributor Author

runsisi commented May 15, 2017

@dillaman i think we need a while True: wrap around it, like https://github.com/ceph/ceph/blob/master/src/pybind/rbd/rbd.pyx#L2855 did ?

@dillaman

This comment has been minimized.

Copy link
Contributor

dillaman commented May 15, 2017

@runsisi Yes -- that is indeed correct.

@runsisi runsisi force-pushed the runsisi:wip-fix-trashlist branch from 7f16710 to dcfa90e May 17, 2017

@runsisi

This comment has been minimized.

Copy link
Contributor Author

runsisi commented May 17, 2017

@dillaman updated as you suggested, please take a look, thanks!

@dillaman

This comment has been minimized.

Copy link
Contributor

dillaman commented May 17, 2017

@runsisi Nit: can you squash your "librbd" commits down into a single commit. Also, were you planning to submit a commit to fix the trash_list python API?

@runsisi runsisi force-pushed the runsisi:wip-fix-trashlist branch from dcfa90e to 34fbe4f May 17, 2017

@runsisi

This comment has been minimized.

Copy link
Contributor Author

runsisi commented May 17, 2017

@dillaman done, and the trash_list python API fix is at #15134 , thanks!

runsisi added some commits May 15, 2017

librbd: translate error -ENOENT to 0 for list APIs
Signed-off-by: runsisi <runsisi@zte.com.cn>
rbd: remove unnecessary -ENOENT check for rbd cli
Signed-off-by: runsisi <runsisi@zte.com.cn>

@runsisi runsisi force-pushed the runsisi:wip-fix-trashlist branch from 34fbe4f to 6d991c5 May 17, 2017

@dillaman
Copy link
Contributor

dillaman left a comment

lgtm

@dillaman

This comment has been minimized.

Copy link
Contributor

dillaman commented May 17, 2017

@runsisi thanks!

@dillaman dillaman merged commit 726515e into ceph:master May 18, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@runsisi runsisi deleted the runsisi:wip-fix-trashlist branch May 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.