Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347570
b: refs/heads/master
c: db2388b
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder committed Oct 26, 2012
1 parent b57288e commit bc78d32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4634246db8cb2e5117ef7c682efcc383fa3354f8
refs/heads/master: db2388b6ee40a949084e4cdddc3b0a4357068a62
10 changes: 10 additions & 0 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,16 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
if (memcmp(&ondisk->text, RBD_HEADER_TEXT, sizeof (RBD_HEADER_TEXT)))
return false;

/* The bio layer requires at least sector-sized I/O */

if (ondisk->options.order < SECTOR_SHIFT)
return false;

/* If we use u64 in a few spots we may be able to loosen this */

if (ondisk->options.order > 8 * sizeof (int) - 1)
return false;

/*
* The size of a snapshot header has to fit in a size_t, and
* that limits the number of snapshots.
Expand Down

0 comments on commit bc78d32

Please sign in to comment.