diff options
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r-- | fs/dlm/lockspace.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index 56eae4e4a954..ba672fe0a601 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c | |||
@@ -378,6 +378,11 @@ static int new_lockspace(char *name, int namelen, void **lockspace, | |||
378 | if (!try_module_get(THIS_MODULE)) | 378 | if (!try_module_get(THIS_MODULE)) |
379 | return -EINVAL; | 379 | return -EINVAL; |
380 | 380 | ||
381 | if (!dlm_user_daemon_available()) { | ||
382 | module_put(THIS_MODULE); | ||
383 | return -EUNATCH; | ||
384 | } | ||
385 | |||
381 | error = 0; | 386 | error = 0; |
382 | 387 | ||
383 | spin_lock(&lslist_lock); | 388 | spin_lock(&lslist_lock); |
@@ -669,7 +674,7 @@ static int release_lockspace(struct dlm_ls *ls, int force) | |||
669 | 674 | ||
670 | dlm_device_deregister(ls); | 675 | dlm_device_deregister(ls); |
671 | 676 | ||
672 | if (force < 3) | 677 | if (force < 3 && dlm_user_daemon_available()) |
673 | do_uevent(ls, 0); | 678 | do_uevent(ls, 0); |
674 | 679 | ||
675 | dlm_recoverd_stop(ls); | 680 | dlm_recoverd_stop(ls); |
@@ -791,3 +796,20 @@ int dlm_release_lockspace(void *lockspace, int force) | |||
791 | return error; | 796 | return error; |
792 | } | 797 | } |
793 | 798 | ||
799 | void dlm_stop_lockspaces(void) | ||
800 | { | ||
801 | struct dlm_ls *ls; | ||
802 | |||
803 | restart: | ||
804 | spin_lock(&lslist_lock); | ||
805 | list_for_each_entry(ls, &lslist, ls_list) { | ||
806 | if (!test_bit(LSFL_RUNNING, &ls->ls_flags)) | ||
807 | continue; | ||
808 | spin_unlock(&lslist_lock); | ||
809 | log_error(ls, "no userland control daemon, stopping lockspace"); | ||
810 | dlm_ls_stop(ls); | ||
811 | goto restart; | ||
812 | } | ||
813 | spin_unlock(&lslist_lock); | ||
814 | } | ||
815 | |||