]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: check return value during snap_unprotect 1775/head
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 6 May 2014 18:18:28 +0000 (11:18 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 6 May 2014 18:21:09 +0000 (11:21 -0700)
This would only fail if the header object was corrupted, so it's
unlikely to occur in practice.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librbd/internal.cc

index e56ef0897f48c3ddf5e7766f01f95a7592a3a588..1d0e43f4ac44494d06b479d4c5e8eafd1031fd1e 100644 (file)
@@ -664,6 +664,11 @@ namespace librbd {
                                          ictx->header_oid,
                                          snap_id,
                                          RBD_PROTECTION_STATUS_UNPROTECTED);
+    if (r < 0) {
+      lderr(ictx->cct) << "snap_unprotect: error setting unprotected status"
+                      << dendl;
+      goto reprotect_and_return_err;
+    }
     notify_change(ictx->md_ctx, ictx->header_oid, NULL, ictx);
     return 0;