diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2013-02-21 17:39:19 -0800 |
---|---|---|
committer | Josh Durgin <josh.durgin@inktank.com> | 2013-02-21 17:39:22 -0800 |
commit | 94ae72546507799667197fd941633bb1fd2520c2 (patch) | |
tree | 29bc0cfe783793703b2bf9a530fd44922162d57a | |
parent | 6c08c7c1c6d354d090eb16df279d4b63ca7a355a (diff) | |
download | ceph-94ae72546507799667197fd941633bb1fd2520c2.tar.gz |
test_librbd_fsx: fix image closing
Always close the image we opened in check_clone(), and check the
return code of the rbd_close() called before cloning.
Refs: #3958
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r-- | src/test/librbd/fsx.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/librbd/fsx.c b/src/test/librbd/fsx.c index d884173b0cf..725c20886fa 100644 --- a/src/test/librbd/fsx.c +++ b/src/test/librbd/fsx.c @@ -845,7 +845,12 @@ do_clone() simple_err("do_clone: rbd clone", ret); exit(165); } - rbd_close(image); + + if ((ret = rbd_close(image)) < 0) { + simple_err("do_clone: rbd close", ret); + exit(174); + } + if ((ret = rbd_open(ioctx, imagename, &image, NULL)) < 0) { simple_err("do_clone: rbd open", ret); exit(166); @@ -896,6 +901,10 @@ check_clone(int clonenum) exit(171); } close(fd); + if ((ret = rbd_close(cur_image)) < 0) { + simple_err("check_clone: rbd close", ret); + exit(174); + } check_buffers(good_buf, temp_buf, 0, file_info.st_size); unlink(filename); |