Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dlm: add new RELEASE_RECOVER uevent attribute for release_lockspace

RELEASE_RECOVER=0|1 is passed to user space as part of the OFFLINE
uevent for leaving a lockspace, and used by subsequent patches.
RELEASE_RECOVER=1 tells user space that the release_lockspace/leave
should be handled by the remaining lockspace members as if the
leaving node had failed.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>

authored by

Alexander Aring and committed by
David Teigland
5665374c bea90085

+12 -7
+12 -7
fs/dlm/lockspace.c
··· 186 186 187 187 static struct kset *dlm_kset; 188 188 189 - static int do_uevent(struct dlm_ls *ls, int in) 189 + static int do_uevent(struct dlm_ls *ls, int in, unsigned int release_recover) 190 190 { 191 - if (in) 191 + char message[512] = {}; 192 + char *envp[] = { message, NULL }; 193 + 194 + if (in) { 192 195 kobject_uevent(&ls->ls_kobj, KOBJ_ONLINE); 193 - else 194 - kobject_uevent(&ls->ls_kobj, KOBJ_OFFLINE); 196 + } else { 197 + snprintf(message, 511, "RELEASE_RECOVER=%u", release_recover); 198 + kobject_uevent_env(&ls->ls_kobj, KOBJ_OFFLINE, envp); 199 + } 195 200 196 201 log_rinfo(ls, "%s the lockspace group...", in ? "joining" : "leaving"); 197 202 ··· 580 575 current lockspace members are (via configfs) and then tells the 581 576 lockspace to start running (via sysfs) in dlm_ls_start(). */ 582 577 583 - error = do_uevent(ls, 1); 578 + error = do_uevent(ls, 1, 0); 584 579 if (error < 0) 585 580 goto out_recoverd; 586 581 ··· 597 592 return 0; 598 593 599 594 out_members: 600 - do_uevent(ls, 0); 595 + do_uevent(ls, 0, 0); 601 596 dlm_clear_members(ls); 602 597 kfree(ls->ls_node_array); 603 598 out_recoverd: ··· 738 733 739 734 if (release_option != DLM_RELEASE_NO_EVENT && 740 735 dlm_user_daemon_available()) 741 - do_uevent(ls, 0); 736 + do_uevent(ls, 0, 0); 742 737 743 738 dlm_recoverd_stop(ls); 744 739