Project

General

Profile

Bug #3063

rbd: snapshots must be added to end of list

Added by Alex Elder over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

I just found and fixed this bug and I'm going to try to make a
practice of at least documenting the fixes to actual bugs I put
into the rbd code as I go along. (I've been terrible about
keeping up with tracker issues otherwise.)

I'm just going to include the complete patch below.
-----------------------
From: Alex Elder <>
Subject: [PATCH 1/5] rbd: add new snapshots at the tail

This fixes a bug that went in with this commit:

commit f6e0c99092cca7be00fca4080cfc7081739ca544
Author: Alex Elder &lt;&gt;
Date: Thu Aug 2 11:29:46 2012 -0500
rbd: simplify __rbd_init_snaps_header()

The problem is that a new rbd snapshot needs to go either after an
existing snapshot entry, or at the end of an rbd device's snapshot
list. As originally coded, it is placed at the beginning. This was
based on the assumption the list would be empty (so it wouldn't
matter), but in fact if multiple new snapshots are added to an empty
list in one shot the list will be non-empty after the first one is
added.

Signed-off-by: Alex Elder <>
---
drivers/block/rbd.c | 2
1 file changed, 1 insertion(
), 1 deletion()

Index: b/drivers/block/rbd.c ===================================================================
--- a/drivers/block/rbd.c
++ b/drivers/block/rbd.c
@ -2205,7 +2205,7 @ static int __rbd_init_snaps_header(struc
if (snap)
list_add_tail(&new_snap->node, &snap->node);
else
- list_add(&new_snap->node, head);
list_add_tail(&new_snap->node, head);
} else {
/* Already have this one */

History

#1 Updated by Sage Weil over 11 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF