]> sourceware.org Git - lvm2.git/commitdiff
cmirrord now returns log name to kernel in CTR so it can be registered
authorJonathan Earl Brassow <jbrassow@redhat.com>
Fri, 14 Oct 2011 14:18:49 +0000 (14:18 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Fri, 14 Oct 2011 14:18:49 +0000 (14:18 +0000)
Version 2 of the userspace log protocol accepts return information during the
DM_ULOG_CTR exchange.  The return information contains the name of the log
device that is being used (if there is one).  The kernel can then register the
device via 'dm_get_device'.  Amoung other things, this allows for userspace to
assemble a correct dependency tree of devices - critical for LVM handling of
suspend/resume calls.

Also, update dm-log-userspace.h to match the kernel header associated with
this protocol change.  (Includes a version inc.)

WHATS_NEW
daemons/cmirrord/functions.c
libdm/misc/dm-log-userspace.h

index ec5f02380b9b99894f0f9fcfaea5d95c799ba996..795a5927db8dafc5eb5abc8baff1b831fdb19ae1 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Log dev name now returned to kernel for registering during cmirror CTR.
   Fix lv_info open_count test for disabled verify_udev_operations (2.02.86).
   Simplify code for lvm worker thread in clvmd.                     
   Use pthread_barrier to synchronize clvmd threads at startup.
index 192ab40ea8ac4550dd6514b432c6becd37f85407..c83e2b5877e85b0a227c9995161710fb5f4cc78c 100644 (file)
@@ -597,7 +597,10 @@ static int clog_ctr(struct dm_ulog_request *rq)
        /* We join the CPG when we resume */
 
        /* No returning data */
-       rq->data_size = 0;
+       if ((rq->version > 1) && !strcmp(argv[0], "clustered-disk"))
+               rq->data_size = sprintf(rq->data, "%s", argv[1]) + 1;
+       else
+               rq->data_size = 0;
 
        if (r) {
                LOG_ERROR("Failed to create cluster log (%s)", rq->uuid);
index b723e355d612cc8b89194b9c66d3e5e59c65d280..331793867c2c3bbb92fab1ef0753b7a068be2806 100644 (file)
  * Payload-to-userspace:
  *     A single string containing all the argv arguments separated by ' 's
  * Payload-to-kernel:
- *     None.  ('data_size' in the dm_ulog_request struct should be 0.)
+ *     The name of the device that is used as the backing store for the log
+ *      data.  'dm_get_device' will be called on this device.  ('dm_put_device'
+ *      will be called on this device automatically after calling DM_ULOG_DTR.)
+ *      If there is no device needed for log data, 'data_size' in the
+ *      dm_ulog_request struct should be 0.
  *
  * The UUID contained in the dm_ulog_request structure is the reference that
  * will be used by all request types to a specific log.  The constructor must
- * record this assotiation with instance created.
+ * record this assotiation with the instance created.
  *
  * When the request has been processed, user-space must return the
- * dm_ulog_request to the kernel - setting the 'error' field and
- * 'data_size' appropriately.
+ * dm_ulog_request to the kernel - setting the 'error' field, filling the
+ * data field with the log device if necessary, and setting 'data_size'
+ * appropriately.
  */
 #define DM_ULOG_CTR                    1
 
  * dm_ulog_request or a change in the way requests are
  * issued/handled.  Changes are outlined here:
  *     version 1:  Initial implementation
+ *     version 2:  DM_ULOG_CTR allowed to return a string containing a
+ *                 device name that is to be registered with DM via
+ *                 'dm_get_device'.
  */
-#define DM_ULOG_REQUEST_VERSION 1
+#define DM_ULOG_REQUEST_VERSION 2
 
 struct dm_ulog_request {
        /*
This page took 0.049545 seconds and 5 git commands to generate.