diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-13 02:37:53 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-13 02:37:53 +0200 |
commit | 964a4eacef67503a1154f7e0a75f52fbdce52022 (patch) | |
tree | 7654667330f1996a710c418ba9a8a058ab636aec /fs/dlm | |
parent | Merge tag '9p-for-5.3' of git://github.com/martinetd/linux (diff) | |
parent | dlm: no need to check return value of debugfs_create functions (diff) | |
download | linux-964a4eacef67503a1154f7e0a75f52fbdce52022.tar.xz linux-964a4eacef67503a1154f7e0a75f52fbdce52022.zip |
Merge tag 'dlm-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
Pull dlm updates from David Teigland:
"This set removes some unnecessary debugfs error handling, and checks
that lowcomms workqueues are not NULL before destroying"
* tag 'dlm-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
dlm: no need to check return value of debugfs_create functions
dlm: check if workqueues are NULL before flushing/destroying
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/debug_fs.c | 21 | ||||
-rw-r--r-- | fs/dlm/dlm_internal.h | 8 | ||||
-rw-r--r-- | fs/dlm/lowcomms.c | 18 | ||||
-rw-r--r-- | fs/dlm/main.c | 5 |
4 files changed, 19 insertions, 33 deletions
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index 0e941d42e3e9..d6bbccb0ed15 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c @@ -737,7 +737,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls) debugfs_remove(ls->ls_debug_toss_dentry); } -int dlm_create_debug_file(struct dlm_ls *ls) +void dlm_create_debug_file(struct dlm_ls *ls) { char name[DLM_LOCKSPACE_LEN + 8]; @@ -748,8 +748,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) dlm_root, ls, &format1_fops); - if (!ls->ls_debug_rsb_dentry) - goto fail; /* format 2 */ @@ -761,8 +759,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) dlm_root, ls, &format2_fops); - if (!ls->ls_debug_locks_dentry) - goto fail; /* format 3 */ @@ -774,8 +770,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) dlm_root, ls, &format3_fops); - if (!ls->ls_debug_all_dentry) - goto fail; /* format 4 */ @@ -787,8 +781,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) dlm_root, ls, &format4_fops); - if (!ls->ls_debug_toss_dentry) - goto fail; memset(name, 0, sizeof(name)); snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); @@ -798,21 +790,12 @@ int dlm_create_debug_file(struct dlm_ls *ls) dlm_root, ls, &waiters_fops); - if (!ls->ls_debug_waiters_dentry) - goto fail; - - return 0; - - fail: - dlm_delete_debug_file(ls); - return -ENOMEM; } -int __init dlm_register_debugfs(void) +void __init dlm_register_debugfs(void) { mutex_init(&debug_buf_lock); dlm_root = debugfs_create_dir("dlm", NULL); - return dlm_root ? 0 : -ENOMEM; } void dlm_unregister_debugfs(void) diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index da1173a0b274..416d9de35679 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h @@ -719,14 +719,14 @@ int dlm_plock_init(void); void dlm_plock_exit(void); #ifdef CONFIG_DLM_DEBUG -int dlm_register_debugfs(void); +void dlm_register_debugfs(void); void dlm_unregister_debugfs(void); -int dlm_create_debug_file(struct dlm_ls *ls); +void dlm_create_debug_file(struct dlm_ls *ls); void dlm_delete_debug_file(struct dlm_ls *ls); #else -static inline int dlm_register_debugfs(void) { return 0; } +static inline void dlm_register_debugfs(void) { } static inline void dlm_unregister_debugfs(void) { } -static inline int dlm_create_debug_file(struct dlm_ls *ls) { return 0; } +static inline void dlm_create_debug_file(struct dlm_ls *ls) { } static inline void dlm_delete_debug_file(struct dlm_ls *ls) { } #endif diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 114ebfe30929..3951d39b9b75 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1628,8 +1628,10 @@ static void clean_writequeues(void) static void work_stop(void) { - destroy_workqueue(recv_workqueue); - destroy_workqueue(send_workqueue); + if (recv_workqueue) + destroy_workqueue(recv_workqueue); + if (send_workqueue) + destroy_workqueue(send_workqueue); } static int work_start(void) @@ -1689,13 +1691,17 @@ static void work_flush(void) struct hlist_node *n; struct connection *con; - flush_workqueue(recv_workqueue); - flush_workqueue(send_workqueue); + if (recv_workqueue) + flush_workqueue(recv_workqueue); + if (send_workqueue) + flush_workqueue(send_workqueue); do { ok = 1; foreach_conn(stop_conn); - flush_workqueue(recv_workqueue); - flush_workqueue(send_workqueue); + if (recv_workqueue) + flush_workqueue(recv_workqueue); + if (send_workqueue) + flush_workqueue(send_workqueue); for (i = 0; i < CONN_HASH_SIZE && ok; i++) { hlist_for_each_entry_safe(con, n, &connection_hash[i], list) { diff --git a/fs/dlm/main.c b/fs/dlm/main.c index 39579927ed84..afc66a1346d3 100644 --- a/fs/dlm/main.c +++ b/fs/dlm/main.c @@ -35,9 +35,7 @@ static int __init init_dlm(void) if (error) goto out_lockspace; - error = dlm_register_debugfs(); - if (error) - goto out_config; + dlm_register_debugfs(); error = dlm_user_init(); if (error) @@ -61,7 +59,6 @@ static int __init init_dlm(void) dlm_user_exit(); out_debug: dlm_unregister_debugfs(); - out_config: dlm_config_exit(); out_lockspace: dlm_lockspace_exit(); |