Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331631
b: refs/heads/master
c: 28cb775
h: refs/heads/master
i:
  331629: b0b28d2
  331627: f2add33
  331623: fc94344
  331615: 96a7865
v: v3
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent d94d2b2 commit 1708694
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a52325f61760c6a7d7f3ea9736029bc9f63e7f3
refs/heads/master: 28cb775de1bd1bcc62c43f767ab81b7b9cfb6678
15 changes: 12 additions & 3 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,14 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
header->comp_type = ondisk->options.comp_type;
header->total_snaps = snap_count;

/* Set up the snapshot context */
/*
* If the number of snapshot ids provided by the caller
* doesn't match the number in the entire context there's
* no point in going further. Caller will try again after
* getting an updated snapshot context from the server.
*/
if (allocated_snaps != snap_count)
return 0;

size = sizeof (struct ceph_snap_context);
size += snap_count * sizeof (header->snapc->snaps[0]);
Expand All @@ -552,8 +559,10 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
header->snapc->seq = le64_to_cpu(ondisk->snap_seq);
header->snapc->num_snaps = snap_count;

if (snap_count && allocated_snaps == snap_count) {
int i;
/* Fill in the snapshot information */

if (snap_count) {
u32 i;

for (i = 0; i < snap_count; i++) {
header->snapc->snaps[i] =
Expand Down

0 comments on commit 1708694

Please sign in to comment.