]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_librbd_fsx: fix image closing
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 22 Feb 2013 01:39:19 +0000 (17:39 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 22 Feb 2013 01:39:22 +0000 (17:39 -0800)
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>
src/test/librbd/fsx.c

index d884173b0cfe369c6eb12deb977a3797fed42faf..725c20886fafbc5a11bc0ebec738219e9c73dcdd 100644 (file)
@@ -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);