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

rbd: filter out UserSnapshotNamespace in do_disk_usage #20532

Merged
merged 1 commit into from Feb 27, 2018

Conversation

Projects
None yet
2 participants
@Songweibin
Copy link
Contributor

commented Feb 22, 2018

Signed-off-by: songweibin song.weibin@zte.com.cn

rbd: filter out UserSnapshotNamespace in do_disk_usage
Signed-off-by: songweibin <song.weibin@zte.com.cn>
@@ -155,6 +155,11 @@ static int do_disk_usage(librbd::RBD &rbd, librados::IoCtx &io_ctx,
continue;
}

snap_list.erase(remove_if(snap_list.begin(),

This comment has been minimized.

Copy link
@Songweibin

Songweibin Feb 22, 2018

Author Contributor

@dillaman Shall we display snapshots from all namesapce? If so, we can add a --all flag here, and another bug needs to be fixed (cause of [1]librbd::image::OpenRequest::send_set_snap() and [2]librbd::api::DiffIterate<>::diff_iterate() always passing UserSnapshotNamespace):

root@s222:/ceph-dev/build# rbd snap ls img1 -a
SNAPID NAME                                      SIZE TIMESTAMP                NAMESPACE            
     4 6ae85382-edf6-4bb9-8e70-6b855c4dde6a 102400 kB Thu Feb 22 16:39:45 2018 trash                
     5 .group.3_10542ae8944a_104d3d1b58ba   102400 kB Thu Feb 22 16:46:21 2018 group (rbd/g1@sanp1)
root@s222:/ceph-dev/build# rbd du img1        
2018-02-22 16:58:10.891 7f06d17fa700 -1 librbd::image::OpenRequest: failed to set image snapshot: (2) No such file or directory
rbd: error opening snapshot img1@6ae85382-edf6-4bb9-8e70-6b855c4dde6a: (2) No such file or directory
NAME PROVISIONED USED 

[1] https://github.com/ceph/ceph/blob/master/src/librbd/image/OpenRequest.cc#L491
[2] https://github.com/ceph/ceph/blob/master/src/librbd/librbd.cc#L1732

This comment has been minimized.

Copy link
@dillaman

dillaman Feb 22, 2018

Contributor

Such a change would require new API methods to set a snapshot by ID (instead of name) and diff_iterate by snapshot id. If you are interested, please feel free to add since I think it would be valuable.

@xiexingguo xiexingguo requested a review from dillaman Feb 22, 2018

@dillaman
Copy link
Contributor

left a comment

lgtm

@dillaman dillaman merged commit e6acc64 into ceph:master Feb 27, 2018

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@Songweibin Songweibin deleted the Songweibin:wip-du-user branch Feb 27, 2018

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.