aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-08-30 09:09:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-08-30 09:09:54 -0700
commitfbcb0b4feb5c3f5431a2ed9f0211653864cf2104 (patch)
treeb0558ea758408c579bd62b31940f3480d4f3da1c
parent0d70787b65941a8db36fd2c35d25c93178f8b545 (diff)
parentd435c9a7b85be1e820668d2f3718c2d9f24d5548 (diff)
downloadlinux-fbcb0b4feb5c3f5431a2ed9f0211653864cf2104.tar.gz
Merge tag 'ceph-for-5.3-rc7' of git://github.com/ceph/ceph-client
Pull two ceph fixes from Ilya Dryomov: "A fix for a -rc1 regression in rbd and a trivial static checker fix" * tag 'ceph-for-5.3-rc7' of git://github.com/ceph/ceph-client: rbd: restore zeroing past the overlap when reading from parent libceph: don't call crypto_free_sync_skcipher() on a NULL tfm
-rw-r--r--drivers/block/rbd.c11
-rw-r--r--net/ceph/crypto.c6
2 files changed, 15 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 3327192bb71f73..c8fb886aebd4e9 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3038,6 +3038,17 @@ again:
}
return true;
case RBD_OBJ_READ_PARENT:
+ /*
+ * The parent image is read only up to the overlap -- zero-fill
+ * from the overlap to the end of the request.
+ */
+ if (!*result) {
+ u32 obj_overlap = rbd_obj_img_extents_bytes(obj_req);
+
+ if (obj_overlap < obj_req->ex.oe_len)
+ rbd_obj_zero_range(obj_req, obj_overlap,
+ obj_req->ex.oe_len - obj_overlap);
+ }
return true;
default:
BUG();
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index 5d6724cee38f90..4f75df40fb121f 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -136,8 +136,10 @@ void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
if (key) {
kfree(key->key);
key->key = NULL;
- crypto_free_sync_skcipher(key->tfm);
- key->tfm = NULL;
+ if (key->tfm) {
+ crypto_free_sync_skcipher(key->tfm);
+ key->tfm = NULL;
+ }
}
}