From: Linus Torvalds Date: Sat, 29 Jun 2013 17:31:15 +0000 (-0700) Subject: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph... X-Git-Tag: v3.10~8 X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=bd2931b5cff6a3bf39bfe15fae051fb8229c0029;hp=-c;p=~andy%2Flinux Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client Pull Ceph fix from Sage Weil: "This is a recently spotted regression in the snapshot behavior... It turns out several tests weren't being run in the nightlies so this took a while to spot" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: rbd: send snapshot context with writes --- bd2931b5cff6a3bf39bfe15fae051fb8229c0029 diff --combined drivers/block/rbd.c index 247bf309973,c8eb9cb77d3..aff789d6fcc --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@@ -497,7 -497,7 +497,7 @@@ static int rbd_open(struct block_devic return 0; } -static int rbd_release(struct gendisk *disk, fmode_t mode) +static void rbd_release(struct gendisk *disk, fmode_t mode) { struct rbd_device *rbd_dev = disk->private_data; unsigned long open_count_before; @@@ -510,6 -510,8 +510,6 @@@ mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); put_device(&rbd_dev->dev); mutex_unlock(&ctl_mutex); - - return 0; } static const struct block_device_operations rbd_bd_ops = { @@@ -1198,7 -1200,7 +1198,7 @@@ static struct bio *bio_clone_range(stru /* Find first affected segment... */ resid = offset; - __bio_for_each_segment(bv, bio_src, idx, 0) { + bio_for_each_segment(bv, bio_src, idx) { if (resid < bv->bv_len) break; resid -= bv->bv_len; @@@ -2252,13 -2254,17 +2252,17 @@@ static int rbd_img_request_fill(struct obj_request->pages, length, offset & ~PAGE_MASK, false, false); + /* + * set obj_request->img_request before formatting + * the osd_request so that it gets the right snapc + */ + rbd_img_obj_request_add(img_request, obj_request); if (write_request) rbd_osd_req_format_write(obj_request); else rbd_osd_req_format_read(obj_request); obj_request->img_offset = img_offset; - rbd_img_obj_request_add(img_request, obj_request); img_offset += length; resid -= length;