[PATCH 0/2] rbd: clear EXISTS flag for disappearing snapshot

2013-05-01 Thread Alex Elder
The first patch in this series puts back some functionality that was deleted inadvertently by the previous commit. Josh pointed out it had disappeared. The second one replaces a linear search of snapshot ids with a binary search for efficiency. -Alex

[PATCH 1/2] rbd: clear EXISTS flag if mapped snapshot disappears

2013-05-01 Thread Alex Elder
snapshot is still present in the updated snapshot context. If it is not, clear the flag. It is not necessary to check this in the initial probe, because the probe will not succeed if the snapshot doesn't exist. This resolves: http://tracker.ceph.com/issues/4880 Signed-off-by: Alex Elder el

[PATCH 2/2] rbd: use binary search for snapshot lookup

2013-05-01 Thread Alex Elder
Use bsearch(3) to make snapshot lookup by id more efficient. (There could be thousands of snapshots, and conceivably many more.) Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff

[PATCH 0/4] rbd: use slab caches for frequently allocated structures

2013-05-01 Thread Alex Elder
This series adds some slab caches for structures related to rbd osd requests. -Alex [PATCH 1/4] rbd: allocate image requests with a slab allocator [PATCH 2/4] rbd: allocate name separate from obj_request [PATCH 3/4] rbd: allocate object requests with a

[PATCH 1/4] rbd: allocate image requests with a slab allocator

2013-05-01 Thread Alex Elder
Create a slab cache to manage rbd_img_request allocation. Nothing too fancy at this point--we'll still initialize everything at allocation time (no constructor) This is part of: http://tracker.ceph.com/issues/3926 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 39

[PATCH 2/4] rbd: allocate name separate from obj_request

2013-05-01 Thread Alex Elder
The next patch will define a slab allocator for a object requests. To use that we'll need to allocate the name of an object separate from the request structure itself. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH 3/4] rbd: allocate object requests with a slab allocator

2013-05-01 Thread Alex Elder
Create a slab cache to manage rbd_obj_request allocation. We aren't using a constructor, and we'll zero-fill object request structures when they're allocated. This is part of: http://tracker.ceph.com/issues/3926 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 23

[PATCH 4/4] rbd: allocate image object names with a slab allocator

2013-05-01 Thread Alex Elder
://tracker.ceph.com/issues/3926 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 28a5ea3..8d9aeef 100644 --- a/drivers/block/rbd.c +++ b

[PATCH 0/3] libceph: use slab caches in messenger and osd osd client

2013-05-01 Thread Alex Elder
This series adds slab caches to some frequently-allocated data structures in the messenger and the osd client. -Alex [PATCH 1/3] libceph: allocate ceph messages with a slab allocator [PATCH 2/3] libceph: allocate ceph message data with a slab [PATCH 3/3]

[PATCH 1/3] libceph: allocate ceph messages with a slab allocator

2013-05-01 Thread Alex Elder
Create a slab cache to manage ceph_msg structure allocation. This is part of: http://tracker.ceph.com/issues/3926 Signed-off-by: Alex Elder el...@inktank.com --- net/ceph/messenger.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/net

[PATCH 2/3] libceph: allocate ceph message data with a slab

2013-05-01 Thread Alex Elder
Create a slab cache to manage ceph_msg_data structure allocation. This is part of: http://tracker.ceph.com/issues/3926 Signed-off-by: Alex Elder el...@inktank.com --- net/ceph/messenger.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/net

[PATCH 3/3] libceph: use slab cache for osd client requests

2013-05-01 Thread Alex Elder
Create a slab cache to manage allocation of ceph_osdc_request structures. This resolves: http://tracker.ceph.com/issues/3926 Signed-off-by: Alex Elder el...@inktank.com --- include/linux/ceph/osd_client.h |3 +++ net/ceph/ceph_common.c |7 +++ net/ceph/osd_client.c

Re: [PATCH 0/2] rbd: clear EXISTS flag for disappearing snapshot

2013-05-01 Thread Alex Elder
On 05/01/2013 04:29 PM, Alex Elder wrote: The first patch in this series puts back some functionality that was deleted inadvertently by the previous commit. Josh pointed out it had disappeared. The second one replaces a linear search of snapshot ids with a binary search for efficiency

Re: rbd: enforce parent overlap

2013-04-30 Thread Alex Elder
On 04/30/2013 02:24 AM, Dan Carpenter wrote: Hello Alex Elder, This is a semi-automatic email about new static checker warnings. Cool, I've never used smatch before. Great to get these automated warnings. I looked at this, and this is not a problem. An earlier commit, about 10 before

[PATCH 0/2] libceph: define ceph_create_snap_context()

2013-04-30 Thread Alex Elder
While reviewing a recent rbd change Josh suggested that a function I created for creating a snapshot context really belonged in libceph. These patches do that. The first defines the function in a new source file, and the second puts it to work. -Alex

[PATCH 1/2] libceph: create source file net/ceph/snapshot.c

2013-04-30 Thread Alex Elder
() and ceph_put_snap_context() there too. (The benefit of inlining those is very small, and I'd rather keep this collection of functions together.) Signed-off-by: Alex Elder el...@inktank.com --- include/linux/ceph/libceph.h | 30 +++- net/ceph/Makefile|2 +- net/ceph/snapshot.c

[PATCH 2/2] ceph: use ceph_create_snap_context()

2013-04-30 Thread Alex Elder
Now that we have a library routine to create snap contexts, use it. This is part of: http://tracker.ceph.com/issues/4857 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 41 ++--- fs/ceph/snap.c |3 +-- 2 files changed, 7

[PATCH 0/3] rbd: a few small issues

2013-04-30 Thread Alex Elder
This series has two patches that fix two annoyances and a third that makes snapshot names be treated consistently as constant data. -Alex [PATCH 1/3] rbd: fix up the layering warning message [PATCH 2/3] rbd: don't revalidate so much [PATCH 3/3] rbd: snap

[PATCH 2/3] rbd: don't revalidate so much

2013-04-30 Thread Alex Elder
size, most of the time it does not. Record the image size before and after the refresh, and only call revalidate_disk() if it changes. This resolves: http://tracker.ceph.com/issues/4867 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |5 - 1 file changed, 4

[PATCH 3/3] rbd: snap names are pointer to constant data

2013-04-30 Thread Alex Elder
Make explicit that snapshot names don't change by making functions return and take parameters that that point to const qualified data. This resolves: http://tracker.ceph.com/issues/4857 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 14 +++--- 1 file changed

[PATCH 0/5] rbd: eliminate object version tracking

2013-04-30 Thread Alex Elder
As of this patch: rbd: set up watch in rbd_dev_image_probe() there is no longer any need to keep track of the object version for an rbd header object. Getting rid of it allows quite a bit of code to get simplified, and the patches after the first in this series do just that.

[PATCH 1/5] rbd: stop tracking header object version

2013-04-30 Thread Alex Elder
the header's object version any more, so stop doing so. We'll be able to simplify some more rbd code in the next few patches as a result of this. This resolves: http://tracker.ceph.com/issues/3952 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 11 +-- 1 file

[PATCH 2/5] rbd: get rid of some version parameters

2013-04-30 Thread Alex Elder
of them. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c4707dc..0bfc3e9 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2838,8

[PATCH 3/5] rbd: more version parameter removal

2013-04-30 Thread Alex Elder
Continued from the last patch, more parameters that can go away because we no longer have a need to track object versions. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff

[PATCH 4/5] rbd: drop rbd_obj_method_sync() version parameter

2013-04-30 Thread Alex Elder
Only NULL is passed as the version argument to rbd_obj_method_sync(), so get rid of it. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c

[PATCH 0/4] rbd: get rid of the snapshot list

2013-04-30 Thread Alex Elder
An rbd device structure maintains a list of snapshot structures whose purpose is to cache the name, size, and features associated with a snapshot id. The main reason it was needed was related to the presence of Linux device information for snapshots, which we no longer have. We can look up the

[PATCH 1/4] rbd: look up snapshot name in names buffer

2013-04-30 Thread Alex Elder
, _rbd_dev_v1_snap_name(). Have that function return a dynamically-allocated copy of the name, and don't duplicate it in rbd_dev_v1_snap_info(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 40 ++-- 1 file changed, 30 insertions(+), 10

[PATCH 2/4] rbd: use snap_id not index to look up snap info

2013-04-30 Thread Alex Elder
() rbd_dev_v2_snap_info() A new function, rbd_dev_snap_index(), determines the snap index for format 1 images and uses it to look up the name. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 68 --- 1 file changed, 37 insertions(+), 31

[PATCH 4/4] rbd: kill off the snapshot list

2013-04-30 Thread Alex Elder
that previously were associated with snapshots. So get rid of the snapshot list, and struct rbd_snap, and the hundreds of lines of code that supported them. This resolves: http://tracker.ceph.com/issues/4868 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 257

Re: [PATCH 0/2] libceph: define ceph_create_snap_context()

2013-04-30 Thread Alex Elder
On 04/30/2013 07:17 AM, Alex Elder wrote: While reviewing a recent rbd change Josh suggested that a function I created for creating a snapshot context really belonged in libceph. These patches do that. The first defines the function in a new source file, and the second puts it to work

Re: [PATCH 0/4] rbd: get rid of the snapshot list

2013-04-30 Thread Alex Elder
On 04/30/2013 07:57 PM, Josh Durgin wrote: On 04/30/2013 05:41 AM, Alex Elder wrote: An rbd device structure maintains a list of snapshot structures whose purpose is to cache the name, size, and features associated with a snapshot id. The main reason it was needed was related to the presence

Re: [PATCH 0/4] rbd: get rid of the snapshot list

2013-04-30 Thread Alex Elder
On 04/30/2013 08:12 PM, Alex Elder wrote: On that, the only thing inefficient is looking up the snapshot id given its name. It is so inefficient it might be worth offering an op that does that for us, because as it is we have to do a sequential search to find out a snapshot's name. (Maybe

Re: [PATCH 3/5] rbd: define rbd_dev_unprobe()

2013-04-30 Thread Alex Elder
On 04/30/2013 08:11 PM, Josh Durgin wrote: There are a couple calls that look unnecessary noted below. You were correct, in the two places that you mentioned, rbd_parent_remove() should go away. I'll do that before I commit. -Alex Other than that:

Re: [PATCH] rbd: fix a bug in resizing a mapping

2013-04-29 Thread Alex Elder
On 04/27/2013 07:39 AM, Alex Elder wrote: On 04/27/2013 07:18 AM, Alex Elder wrote: When a snapshot context update occurs, rbd_update_mapping_size() is called to set the capacity of the disk to record the updated size of the image in case it has changed. I have updated a few patches

Re: [PATCH 0/5] rbd: avoid snapshot update race

2013-04-29 Thread Alex Elder
On 04/27/2013 02:42 PM, Alex Elder wrote: On 04/27/2013 02:37 PM, Alex Elder wrote: This series ends with a patch that avoids a race involving the initial read of an rbd image header and a change to the snapshot context. The problem occurs because the rbd client sets up its watch request

[PATCH 0/5] rbd: only set up Linux files for mapped devices

2013-04-29 Thread Alex Elder
This series does a few more things to separate the ceph and Linux side of rbd device initialization, and to make sure things get cleaned up in a sane way when errors occur. The last patch makes it so only the rbd image getting mapped has Linux device and sysfs stuff associated with them. The

[PATCH 2/5] rbd: don't destroy rbd_dev in device release function

2013-04-29 Thread Alex Elder
-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 5904819..feaa2e9 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c

[PATCH 3/5] rbd: define rbd_dev_unprobe()

2013-04-29 Thread Alex Elder
should be a little easier to verify than they used to be. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 78 +-- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index

[PATCH 4/5] rbd: don't have device release destroy rbd_dev

2013-04-29 Thread Alex Elder
Currently an rbd_device structure gets destroyed from the release routine for the device embedded within it. Stop doing that, instead calling rbd_dev_image_release() right after rbd_bus_del_dev() wherever the latter is called. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c

[PATCH 5/5] rbd: set up devices only for mapped images

2013-04-29 Thread Alex Elder
/issues/4774 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index ff850e9..8b680ad 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4880,14

[PATCH 1/5] rbd: drop module later

2013-04-29 Thread Alex Elder
Drop the module reference at the end of rbd_remove() for symmetry with adding a reference at the top of rbd_add(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block

[PATCH 0/4] rbd: reorder some setup operations

2013-04-27 Thread Alex Elder
The first patch of this series doesn't really belong, but I threw it in anyway. The other three defer doing some initialization of an rbd device until just before it gets activated by a call to add_disk(). -Alex [PATCH 1/4] rbd: fix up some sysfs stuff

[PATCH 1/4] rbd: fix up some sysfs stuff

2013-04-27 Thread Alex Elder
-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 37d9349..b6f32c2 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3170,13 +3170,9 @@ static

[PATCH 2/4] rbd: only set device exists flag when ready

2013-04-27 Thread Alex Elder
Hold off setting the EXISTS rbd device flag until just before we announce the disk as available for use. There's no point in doing so any earlier than that, and at that point the device truly is fully set up and ready to use. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c

[PATCH 3/4] rbd: defer setting disk capacity

2013-04-27 Thread Alex Elder
Don't set the disk capacity until right before we announce the device as available for use. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b04e3e1

[PATCH 4/4] rbd: defer setting the mapping size and features

2013-04-27 Thread Alex Elder
There's no need to set the size/features for a mapped device until we're about to make it available for use. So wait until then to do it. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH 1/6] rbd: encapsulate probing for parent devices

2013-04-27 Thread Alex Elder
Encapsulate the code that probes for an rbd device's parent images into a new function, rbd_dev_probe_parent(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 77 +-- 1 file changed, 44 insertions(+), 33 deletions(-) diff

[PATCH 2/6] rbd: encapsulate removing parent devices

2013-04-27 Thread Alex Elder
Encapsulate the code that removes an rbd device's parent images into a new function, rbd_dev_remove_parent(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 46 +++--- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git

[PATCH 3/6] rbd: kill __rbd_remove()

2013-04-27 Thread Alex Elder
The function __rbd_remove() is used in two spots, and it's fairly simple. It combines cleanup of part of the ceph-side state as well as cleaning up the Linux-side state. Just open code it in the two callers and eliminate the function. Signed-off-by: Alex Elder el...@inktank.com --- drivers

[PATCH 4/6] rbd: fix rbd_dev_remove_parent()

2013-04-27 Thread Alex Elder
has parent_spec associated with it. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 9936067..99d231b 100644 --- a/drivers/block/rbd.c +++ b/drivers

[PATCH 5/6] rbd: remove parent devices on probe error

2013-04-27 Thread Alex Elder
. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 99d231b..c81b319 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4806,8 +4806,8 @@ static

[PATCH 6/6] rbd: probe for the parent earlier

2013-04-27 Thread Alex Elder
Probe for a parent device earlier in rbd_dev_probe_finish(), before starting to set up the Linux side of the rbd device. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/block/rbd.c b

Re: [PATCH] rbd: fix a bug in resizing a mapping

2013-04-27 Thread Alex Elder
On 04/27/2013 07:18 AM, Alex Elder wrote: When a snapshot context update occurs, rbd_update_mapping_size() is called to set the capacity of the disk to record the updated size of the image in case it has changed. This patch, as well as the series of 4 and the series of 6 that I posted after

[PATCH 0/5] rbd: avoid snapshot update race

2013-04-27 Thread Alex Elder
This series ends with a patch that avoids a race involving the initial read of an rbd image header and a change to the snapshot context. The problem occurs because the rbd client sets up its watch request on the header object *after* the initial header read, and if the snapshot context changes

[PATCH 1/5] rbd: move more initialization into rbd_dev_probe_image()

2013-04-27 Thread Alex Elder
Move a block of initialization related to the ceph-side of an rbd image out of rbd_dev_probe_finish() and into rbd_dev_probe_image(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions

[PATCH 2/5] rbd: define rbd_header_name()

2013-04-27 Thread Alex Elder
Set an rbd device's image format value in rbd_dev_probe_image(), and use it in a new function rbd_header_name(), which allocates and formats the name of the header object for the rbd device. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 77

[PATCH 4/5] rbd: don't bother checking whether order changes

2013-04-27 Thread Alex Elder
first, so we can no longer make this order check. The order really can't ever change anyway--this was just a sanity check. So get rid of it. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |8 1 file changed, 8 deletions(-) diff --git a/drivers/block/rbd.c b

[PATCH 5/5] rbd: set up watch in rbd_dev_probe_image()

2013-04-27 Thread Alex Elder
, and it gets changed between that time and the time we get the watch set up. This resolves: http://tracker.ceph.com/issues/3871 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/block/rbd.c

Re: [PATCH 0/5] rbd: avoid snapshot update race

2013-04-27 Thread Alex Elder
On 04/27/2013 02:37 PM, Alex Elder wrote: This series ends with a patch that avoids a race involving the initial read of an rbd image header and a change to the snapshot context. The problem occurs because the rbd client sets up its watch request on the header object *after* the initial

[PATCH 3/5] rbd: don't clean up watch in device release function

2013-04-27 Thread Alex Elder
set up, so tear these down also, in rbd_dev_remove_parent(). For now, ignore any errors that occur in this case. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH] rbd: don't create sysfs entries for non-mapped snapshots

2013-04-26 Thread Alex Elder
will be the ability to query these sysfs directories for information about snapshots of mapped images. This resolves: http://tracker.ceph.com/issues/4796 Signed-off-by: Alex Elder el...@inktank.com --- Documentation/ABI/testing/sysfs-bus-rbd | 20 - drivers/block/rbd.c

[PATCH 0/6] rbd: cleanup and plug leaks

2013-04-26 Thread Alex Elder
(This series, and the patch I just posted, are available in the review/wip-rbd-cleanup branch of the ceph-client git repository.) This series is one of several I expect to be posting that are mostly small tweaks and polish to the rbd code. I'm doing a review of the whole thing with an eye toward

[PATCH 1/6] rbd: fix leak of snapshots during initial probe

2013-04-26 Thread Alex Elder
. Move that warning to the common rbd_dev_refresh() function so it gets issued regardless of how it got initiated. This is part of: http://tracker.ceph.com/issues/4803 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 50

[PATCH 3/6] rbd: only update values on snap_info success

2013-04-26 Thread Alex Elder
Change rbd_dev_v2_snap_info() so it only ever sets values of the size and features parameters if looking up the snapshot name was successful. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions

[PATCH 4/6] rbd: rename __rbd_add_snap_dev()

2013-04-26 Thread Alex Elder
this function delete the snapshot from its list (to be symmetrical with its create counterpart) and do that in the caller instead. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/block

[PATCH 5/6] rbd: fix leak of format 2 snapshot names

2013-04-26 Thread Alex Elder
-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 27 --- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 916741b..2b5ba50 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3427,30

[PATCH 2/6] rbd: make snap_size order parameter optional

2013-04-26 Thread Alex Elder
Only one of the two callers of _rbd_dev_v2_snap_size() needs the order value returned. So make that an optional argument--a null pointer if the caller doesn't need it. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH 6/6] rbd: use rbd_obj_method_sync() return value

2013-04-26 Thread Alex Elder
(). Rearrange the error path slightly in rbd_dev_v2_snap_name(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 2b5ba50..dcd8e58 100644

[PATCH] rbd: avoid dropping extra reference in rbd_free_disk()

2013-04-26 Thread Alex Elder
://tracker.ceph.com/issues/4800 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index dcd8e58..9e38967 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c

[PATCH 0/4] rbd: cleanup and leaks #2

2013-04-26 Thread Alex Elder
Cleanup related to spec ids. This one fixes a small leak of the version 2 image id. -Alex [PATCH 1/4] rbd: have rbd_dev_image_id() set format 1 image id [PATCH 2/4] rbd: fix image id leak in initial probe [PATCH 3/4] rbd: have snap_by_name() return a

[PATCH 1/4] rbd: have rbd_dev_image_id() set format 1 image id

2013-04-26 Thread Alex Elder
this by having rbd_dev_image_id() look for -ENOENT from its get_id method call. If that is seen, have it allocate the empty string there rather than depending on rbd_dev_v1_probe() to do it. Also drop a redundant hunk of code in rbd_dev_image_id(). Signed-off-by: Alex Elder el...@inktank.com

[PATCH 2/4] rbd: fix image id leak in initial probe

2013-04-26 Thread Alex Elder
If a format 2 image id is found for an image being mapped, but the subsequent probe of the image fails, rbd_dev_probe() quits without freeing the image id. Fix that. Also drop a redundant hunk of code in rbd_dev_image_id(). Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c

[PATCH 3/4] rbd: have snap_by_name() return a snapshot

2013-04-26 Thread Alex Elder
A function called snap_by_name() ought to just look up a snapshot by name. It does that, but then it assigns some stuff to the rbd device structure as well. Change the function to do just the lookup, and have the caller do the assignments that follow. Signed-off-by: Alex Elder el...@inktank.com

[PATCH 4/4] rbd: set snapshot id in rbd_dev_probe_update_spec()

2013-04-26 Thread Alex Elder
Set the rbd spec's snapshot id for an image getting mapped in rbd_dev_probe_update_spec() rather than rbd_dev_set_mapping(). This is the more logical place for that to happen (even though it means we might look up the snapshot by name twice). Signed-off-by: Alex Elder el...@inktank.com

Re: [PATCH] rbd: avoid dropping extra reference in rbd_free_disk()

2013-04-26 Thread Alex Elder
This patch, and the series of 4 that I also just posted, are available in the review/wip-rbd-cleanup-1 branch of the ceph-client git repository. That branch is based on the branch review/wip-rbd-cleanup. -Alex -- To unsubscribe from this list: send the

[PATCH 5/6, v2] rbd: fix leak of format 2 snapshot names

2013-04-26 Thread Alex Elder
rbd_dev_v1_snap_info() so none of its parameters is side-effected unless it's going to return success. This is part of: http://tracker.ceph.com/issues/4803 Signed-off-by: Alex Elder el...@inktank.com --- v2: kill an errant semicolon; use loop iterator rather than which drivers/block/rbd.c | 30

[PATCH 0/7] rbd: miscellaneous cleanups

2013-04-26 Thread Alex Elder
Another batch of patches. This set is available in the branch review/wip-rbd-cleanup-2 in the ceph-client git repository, which is based on review/wip-rbd-cleanup-1. These are all simple cleanups, no substantive changes. -Alex [PATCH 1/7] rbd: make rbd

[PATCH 1/7] rbd: make rbd spec names pointer to const

2013-04-26 Thread Alex Elder
Make the names and image id in an rbd_spec be pointers to constant data. This required the use of a local variable to hold the snapshot name in rbd_add_parse_args() to avoid a warning. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 16 +--- 1 file changed, 9

[PATCH 2/7] rbd: move stripe_unit and stripe_count into header

2013-04-26 Thread Alex Elder
This commit added fetching if fancy striping parameters: 09186ddb rbd: get and check striping parameters They are almost unused, but the two fields storing the information really belonged in the rbd_image_header structure. This patch moves them there. Signed-off-by: Alex Elder el

[PATCH 4/7] rbd: define rbd snap context routines

2013-04-26 Thread Alex Elder
Encapsulate the creation of a snapshot context for rbd in a new function rbd_snap_context_create(). Define rbd wrappers for getting and dropping references to them once they're created. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 65

[PATCH 5/7] rbd: make rbd_dev_destroy() match rbd_dev_create()

2013-04-26 Thread Alex Elder
Currently, rbd_dev_destroy() does more than just the inverse of what rbd_dev_create() does. Stop doing that, and move the two extra things it does into the three call sites. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |8 ++-- 1 file changed, 6 insertions(+), 2

[PATCH 6/7] rbd: rename rbd_dev_probe()

2013-04-26 Thread Alex Elder
is still the entry point for initializing the full rbd device. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 0356bba..f65310c6 100644 --- a/drivers

[PATCH 7/7] rbd: refactor rbd_dev_probe_update_spec()

2013-04-26 Thread Alex Elder
Fairly straightforward refactoring of rbd_dev_probe_update_spec(). The name is changed to rbd_dev_spec_update(). Rearrange it so nothing gets assigned to the spec until all of the names have been successfully acquired. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 81

Re: [PATCH 3/4] rbd: define zero_pages()

2013-04-22 Thread Alex Elder
On 04/22/2013 03:05 AM, Josh Durgin wrote: On 04/19/2013 03:50 PM, Alex Elder wrote: Define a new function zero_pages() that zeroes a range of memory defined by a page array, along the lines of zero_bio_chain(). It saves and the irq flags like bvec_kmap_irq() does, though I'm not sure

Re: [PATCH 2/2] libceph: validate timespec conversions

2013-04-22 Thread Alex Elder
2013, Matt W. Benjamin wrote: - Alex Elder el...@inktank.com wrote: A ceph timespec contains 32-bit unsigned values for its seconds and nanoseconds components. For a standard timespec, both fields are signed, and the seconds field is almost surely 64 bits. Is the Ceph timespec going

Re: [PATCH] rbd: revalidate_disk upon rbd resize

2013-04-22 Thread Alex Elder
On 04/15/2013 12:24 PM, Alex Elder wrote: On 04/12/2013 08:52 AM, Laurent Barbe wrote: If rbd disk is open and rbd resize is done, new size is not visible by filesystem. Like is done in virtio-blk and dm driver, revalidate_disk() permits to update the bd_inode size. Signed-off-by: Laurent

Re: [PATCH] rbd: revalidate_disk upon rbd resize

2013-04-22 Thread Alex Elder
On 04/22/2013 12:14 PM, Sage Weil wrote: On Mon, 22 Apr 2013, Alex Elder wrote: On 04/15/2013 12:24 PM, Alex Elder wrote: On 04/12/2013 08:52 AM, Laurent Barbe wrote: If rbd disk is open and rbd resize is done, new size is not visible by filesystem. Like is done in virtio-blk and dm driver

Re: [PATCH] rbd: enforce parent overlap

2013-04-22 Thread Alex Elder
On 04/22/2013 01:34 PM, Josh Durgin wrote: Alex Elder el...@inktank.com wrote: (This patch is available in branch review/wip-overlap of the ceph-client git repository.) A clone image has a defined overlap point with its parent image. That is the byte offset beyond which the parent image

Re: [PATCH] rbd: enforce parent overlap

2013-04-22 Thread Alex Elder
On 04/22/2013 01:34 PM, Josh Durgin wrote: + * We need to zero anything beyond the parent overlap + * boundary. Since rbd_img_obj_request_read_callback() + * will zero anything beyond the end of a short read, an + * easy way to do this is to pretend the data from the + *

Re: [PATCH] rbd: activate support for layered images

2013-04-22 Thread Alex Elder
On 04/22/2013 05:24 PM, Josh Durgin wrote: On 04/21/2013 02:54 PM, Alex Elder wrote: (This patch and the next one are available in the review/wip-enable-layering branch of the ceph-client git respository.) Now that we have most everything in place to support layered rbd images, enable

Re: [PATCH] rbd: have rbd_obj_method_sync() return transfer count

2013-04-22 Thread Alex Elder
On 04/22/2013 04:57 PM, Josh Durgin wrote: A couple small things below. With those fixed: Reviewed-by: Josh Durgin josh.dur...@inktank.com On 04/21/2013 02:17 PM, Alex Elder wrote: Callers of rbd_obj_method_sync() don't know how many bytes of data got returned by the class method call

[PATCH 0/2] libceph: odds and ends

2013-04-21 Thread Alex Elder
(These patches, along with the patches I'll be posting in the next few minutes, are available in the review/wip-stripe-v2 branch of the ceph-client git repository.) This series just fleshes out some code in libceph. The first completes the set of definitions for limit values (like U8_MAX) to

[PATCH 1/2] libceph: add signed type limits

2013-04-21 Thread Alex Elder
ever try to put out of range (negative or too big) values into a ceph timespec. Signed-off-by: Alex Elder el...@inktank.com --- include/linux/ceph/decode.h | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h

Re: [PATCH 1/2] libceph: add signed type limits

2013-04-21 Thread Alex Elder
(Sorry, the subject line didn't match the content. Please ignore the previous one--this is the right patch.) Flesh out the limits defined in linux/ceph/decode.h to include the maximum and minimum values for signed type S8, S16, S32, and S64. Signed-off-by: Alex Elder el...@inktank.com

[PATCH 2/2] libceph: validate timespec conversions

2013-04-21 Thread Alex Elder
ever try to put out of range (negative or too big) values into a ceph timespec. Signed-off-by: Alex Elder el...@inktank.com --- include/linux/ceph/decode.h | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h

[PATCH 0/2] rbd: void buffer pointer types

2013-04-21 Thread Alex Elder
This series just makes the buffer pointer parameters for two rbd functions be type (void *) rather than (char *). -Alex [PATCH 1/2] rbd: give rbd_obj_read_sync() buffer void type [PATCH 2/2] rbd: void data pointers for rbd_obj_method_sync() -- To

[PATCH 1/2] rbd: give rbd_obj_read_sync() buffer void type

2013-04-21 Thread Alex Elder
Make the buf parameter into which the data is to be read have type void pointer. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 5724d41..e6da301 100644

[PATCH] rbd: have rbd_obj_method_sync() return transfer count

2013-04-21 Thread Alex Elder
result. This resolves: http://tracker.ceph.com/issues/4773 Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c | 60 --- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c

[PATCH] rbd: get and check striping parameters

2013-04-21 Thread Alex Elder
striping. This is necessary because some images require the STRIPINGV2 feature even if they use the default parameters. (Which is to say the feature bit was erroneously set even if the feature was not used.) This resolves: http://tracker.ceph.com/issues/4709 Signed-off-by: Alex Elder el

[PATCH] rbd: activate support for layered images

2013-04-21 Thread Alex Elder
images that do not have compatible parameters. Signed-off-by: Alex Elder el...@inktank.com --- drivers/block/rbd.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d23cc8f..1ddbcdc 100644 --- a/drivers/block/rbd.c +++ b/drivers

<    1   2   3   4   5   6   7   8   9   10   >