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

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

+19 -33
+2 -19
fs/dlm/debug_fs.c
··· 737 737 debugfs_remove(ls->ls_debug_toss_dentry); 738 738 } 739 739 740 - int dlm_create_debug_file(struct dlm_ls *ls) 740 + void dlm_create_debug_file(struct dlm_ls *ls) 741 741 { 742 742 char name[DLM_LOCKSPACE_LEN + 8]; 743 743 ··· 748 748 dlm_root, 749 749 ls, 750 750 &format1_fops); 751 - if (!ls->ls_debug_rsb_dentry) 752 - goto fail; 753 751 754 752 /* format 2 */ 755 753 ··· 759 761 dlm_root, 760 762 ls, 761 763 &format2_fops); 762 - if (!ls->ls_debug_locks_dentry) 763 - goto fail; 764 764 765 765 /* format 3 */ 766 766 ··· 770 774 dlm_root, 771 775 ls, 772 776 &format3_fops); 773 - if (!ls->ls_debug_all_dentry) 774 - goto fail; 775 777 776 778 /* format 4 */ 777 779 ··· 781 787 dlm_root, 782 788 ls, 783 789 &format4_fops); 784 - if (!ls->ls_debug_toss_dentry) 785 - goto fail; 786 790 787 791 memset(name, 0, sizeof(name)); 788 792 snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); ··· 790 798 dlm_root, 791 799 ls, 792 800 &waiters_fops); 793 - if (!ls->ls_debug_waiters_dentry) 794 - goto fail; 795 - 796 - return 0; 797 - 798 - fail: 799 - dlm_delete_debug_file(ls); 800 - return -ENOMEM; 801 801 } 802 802 803 - int __init dlm_register_debugfs(void) 803 + void __init dlm_register_debugfs(void) 804 804 { 805 805 mutex_init(&debug_buf_lock); 806 806 dlm_root = debugfs_create_dir("dlm", NULL); 807 - return dlm_root ? 0 : -ENOMEM; 808 807 } 809 808 810 809 void dlm_unregister_debugfs(void)
+4 -4
fs/dlm/dlm_internal.h
··· 719 719 void dlm_plock_exit(void); 720 720 721 721 #ifdef CONFIG_DLM_DEBUG 722 - int dlm_register_debugfs(void); 722 + void dlm_register_debugfs(void); 723 723 void dlm_unregister_debugfs(void); 724 - int dlm_create_debug_file(struct dlm_ls *ls); 724 + void dlm_create_debug_file(struct dlm_ls *ls); 725 725 void dlm_delete_debug_file(struct dlm_ls *ls); 726 726 #else 727 - static inline int dlm_register_debugfs(void) { return 0; } 727 + static inline void dlm_register_debugfs(void) { } 728 728 static inline void dlm_unregister_debugfs(void) { } 729 - static inline int dlm_create_debug_file(struct dlm_ls *ls) { return 0; } 729 + static inline void dlm_create_debug_file(struct dlm_ls *ls) { } 730 730 static inline void dlm_delete_debug_file(struct dlm_ls *ls) { } 731 731 #endif 732 732
+12 -6
fs/dlm/lowcomms.c
··· 1628 1628 1629 1629 static void work_stop(void) 1630 1630 { 1631 - destroy_workqueue(recv_workqueue); 1632 - destroy_workqueue(send_workqueue); 1631 + if (recv_workqueue) 1632 + destroy_workqueue(recv_workqueue); 1633 + if (send_workqueue) 1634 + destroy_workqueue(send_workqueue); 1633 1635 } 1634 1636 1635 1637 static int work_start(void) ··· 1691 1689 struct hlist_node *n; 1692 1690 struct connection *con; 1693 1691 1694 - flush_workqueue(recv_workqueue); 1695 - flush_workqueue(send_workqueue); 1692 + if (recv_workqueue) 1693 + flush_workqueue(recv_workqueue); 1694 + if (send_workqueue) 1695 + flush_workqueue(send_workqueue); 1696 1696 do { 1697 1697 ok = 1; 1698 1698 foreach_conn(stop_conn); 1699 - flush_workqueue(recv_workqueue); 1700 - flush_workqueue(send_workqueue); 1699 + if (recv_workqueue) 1700 + flush_workqueue(recv_workqueue); 1701 + if (send_workqueue) 1702 + flush_workqueue(send_workqueue); 1701 1703 for (i = 0; i < CONN_HASH_SIZE && ok; i++) { 1702 1704 hlist_for_each_entry_safe(con, n, 1703 1705 &connection_hash[i], list) {
+1 -4
fs/dlm/main.c
··· 35 35 if (error) 36 36 goto out_lockspace; 37 37 38 - error = dlm_register_debugfs(); 39 - if (error) 40 - goto out_config; 38 + dlm_register_debugfs(); 41 39 42 40 error = dlm_user_init(); 43 41 if (error) ··· 59 61 dlm_user_exit(); 60 62 out_debug: 61 63 dlm_unregister_debugfs(); 62 - out_config: 63 64 dlm_config_exit(); 64 65 out_lockspace: 65 66 dlm_lockspace_exit();