[sheepdog] [PATCH stable-0.9 4/7] sheep: use correct number of copies during reference decrement
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Fri Dec 26 05:41:29 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>
Tested-by: 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 60aff8a..f018115 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -1186,10 +1186,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