[sheepdog] [PATCH] sheep: use correct number of copies during reference decrement
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Wed Nov 26 09:57:54 CET 2014
At Wed, 26 Nov 2014 17:56:34 +0900,
Hitoshi Mitake wrote:
>
> 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(-)
Valerio, could you test it when you have time?
Thanks,
Hitoshi
>
> 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