aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2009-09-04 15:40:34 -0400
committerAlasdair G Kergon <agk@redhat.com>2009-09-04 15:40:34 -0400
commit7ec23d50949d5062b5b749638dd9380ed75e58e5 (patch)
tree28183b6468683cf28abd63b9c322b9f31bcddc5e /include
parentd2b698644c97cb033261536a4f2010924a00eac9 (diff)
dm log: userspace add luid to distinguish between concurrent log instances
Device-mapper userspace logs (like the clustered log) are identified by a universally unique identifier (UUID). This identifier is used to associate requests from the kernel to a specific log in userspace. The UUID must be unique everywhere, since multiple machines may use this identifier when communicating about a particular log, as is the case for cluster logs. Sometimes, device-mapper/LVM may re-use a UUID. This is the case during pvmoves, when moving from one segment of an LV to another, or when resizing a mirror, etc. In these cases, a new log is created with the same UUID and loaded in the "inactive" slot. When a device-mapper "resume" is issued, the "live" table is deactivated and the new "inactive" table becomes "live". (The "inactive" table can also be removed via a device-mapper 'clear' command.) The above two issues were colliding. More than one log was being created with the same UUID, and there was no way to distinguish between them. So, sometimes the wrong log would be swapped out during the exchange. The solution is to create a locally unique identifier, 'luid', to go along with the UUID. This new identifier is used to determine exactly which log is being referenced by the kernel when the log exchange is made. The identifier is not universally safe, but it does not need to be, since create/destroy/suspend/resume operations are bound to a specific machine; and these are the operations that make up the exchange. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dm-log-userspace.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h
index 642e3017b51f..8a1f972c0fe9 100644
--- a/include/linux/dm-log-userspace.h
+++ b/include/linux/dm-log-userspace.h
@@ -371,7 +371,18 @@
371 (DM_ULOG_REQUEST_MASK & (request_type)) 371 (DM_ULOG_REQUEST_MASK & (request_type))
372 372
373struct dm_ulog_request { 373struct dm_ulog_request {
374 char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */ 374 /*
375 * The local unique identifier (luid) and the universally unique
376 * identifier (uuid) are used to tie a request to a specific
377 * mirror log. A single machine log could probably make due with
378 * just the 'luid', but a cluster-aware log must use the 'uuid' and
379 * the 'luid'. The uuid is what is required for node to node
380 * communication concerning a particular log, but the 'luid' helps
381 * differentiate between logs that are being swapped and have the
382 * same 'uuid'. (Think "live" and "inactive" device-mapper tables.)
383 */
384 uint64_t luid;
385 char uuid[DM_UUID_LEN];
375 char padding[7]; /* Padding because DM_UUID_LEN = 129 */ 386 char padding[7]; /* Padding because DM_UUID_LEN = 129 */
376 387
377 int32_t error; /* Used to report back processing errors */ 388 int32_t error; /* Used to report back processing errors */