[sheepdog] [PATCH] sheep: use correct number of copies during reference decrement
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Wed Nov 26 09:56:34 CET 2014
In a case of nr_zones < nr_copies of deleted VDI, current sheep panics
because it cannot obtain correct list of nodes which hold target
ledgers. This patch solves the problem.
Reported-by: Valerio Pachera <sirio81 at gmail.com>
Cc: Valerio Pachera <sirio81 at gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
sheep/ops.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sheep/ops.c b/sheep/ops.c
index 4b54780..babdc47 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -1196,10 +1196,9 @@ int peer_decref_object(struct request *req)
if (is_zero_ledger(ledger)) {
struct sd_node *nodes[SD_MAX_COPIES];
int nr_copies;
- uint32_t vid;
- vid = oid_to_vid(ledger_oid);
- nr_copies = get_vdi_copy_number(vid);
+ nr_copies = get_obj_copy_number(ledger_oid,
+ req->vinfo->nr_zones);
memset(nodes, 0, sizeof(nodes));
/* reclaim object */
--
1.8.3.2
More information about the sheepdog
mailing list