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

os/bluestore/bluestore_tool: add sanity check to get rid of occasionally crash #16013

Merged
merged 3 commits into from Jul 26, 2017

Conversation

Projects
None yet
2 participants
@xiexingguo
Member

xiexingguo commented Jun 29, 2017

No description provided.

xiexingguo added some commits Jun 29, 2017

os/bluestore/bluestore_tool: add sanity check before exporting bluefs
This can prevent crash by directly specifying a bluestore dev, as follow:

----------------------------------------------------------------------------------

./bin/ceph-bluestore-tool --dev ./dev/osd1/block bluefs-export --out /clove/vm/xxg

/clove/vm/xxg/build/ceph/src/os/bluestore/bluefs_types.h: In function 'static void bluefs_fnode_t::_denc_finish(ceph::buffer::ptr::iterator&, __u8*, __u8*, char**, uint32_t*)' thread 7fd4311d0b80 time 2017-06-29 14:59:20.376224
/clove/vm/xxg/build/ceph/src/os/bluestore/bluefs_types.h: 54: FAILED assert(pos <= end)

 ceph version 12.0.3-2356-g9f77a53 (9f77a53) luminous (dev)

----------------------------------------------------------------------------------

The cure is that we require caller pass in path for bluefs-export command instead,
and bluestore will be smart enough to detect the bluefs devices from that.

Also we add some sanity check to detect errors earlier here.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
os/bluestore/bluestore_tool: output error code correctly if we fail t…
…o mkdir

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
os/bluestore/bluestore_tool: portable changes
Finally, control is returned to the host environment. If the value of status is zero or EXIT_SUCCESS, an implementation-defined form of the status successful termination is returned. If the value of status is EXIT_FAILURE , an implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.Finally, control is returned to the host environment. If the value of status is zero or EXIT_SUCCESS, an implementation-defined form of the status successful termination is returned. If the value of status is EXIT_FAILURE , an implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>

@xiexingguo xiexingguo added the tools label Jun 29, 2017

@xiexingguo xiexingguo requested a review from liewegas Jun 29, 2017

@xiexingguo xiexingguo added the cleanup label Jul 1, 2017

@xiexingguo

This comment has been minimized.

Member

xiexingguo commented Jul 26, 2017

@liewegas Mind checking this one too?

@liewegas liewegas added this to the luminous milestone Jul 26, 2017

@liewegas liewegas merged commit c4ee3a5 into ceph:master Jul 26, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
default Build finished.
Details
make check make check succeeded
Details
@liewegas

This comment has been minimized.

Member

liewegas commented Jul 26, 2017

@xiexingguo it would be great if we put together a set of tests for ceph-bluestore-tool...

@xiexingguo

This comment has been minimized.

Member

xiexingguo commented Jul 26, 2017

it would be great if we put together a set of tests for ceph-bluestore-tool

will do when Luminous gets out(currently I am busy in getting familiar with the new features:-)

BTW, #16388 is ready for (another) review

@xiexingguo xiexingguo deleted the xiexingguo:wip-blue-tool branch Jul 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment