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.

Merge tag 'dlm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

Pull dlm updates from David Teigland:
"This set of patches has some minor fixes for message handling, some
misc cleanups, and updates the maintainers entry"

* tag 'dlm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
MAINTAINERS: Update dlm maintainer and web page
dlm: slow down filling up processing queue
dlm: fix no ack after final message
dlm: be sure we reset all nodes at forced shutdown
dlm: fix remove member after close call
dlm: fix creating multiple node structures
fs: dlm: Remove some useless memset()
fs: dlm: Fix the size of a buffer in dlm_create_debug_file()
fs: dlm: Simplify buffer size computation in dlm_create_debug_file()

+53 -20
+2 -2
MAINTAINERS
··· 6172 6172 F: include/video/udlfb.h 6173 6173 6174 6174 DISTRIBUTED LOCK MANAGER (DLM) 6175 - M: Christine Caulfield <ccaulfie@redhat.com> 6175 + M: Alexander Aring <aahringo@redhat.com> 6176 6176 M: David Teigland <teigland@redhat.com> 6177 6177 L: gfs2@lists.linux.dev 6178 6178 S: Supported 6179 - W: http://sources.redhat.com/cluster/ 6179 + W: https://pagure.io/dlm 6180 6180 T: git git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git 6181 6181 F: fs/dlm/ 6182 6182
+7 -11
fs/dlm/debug_fs.c
··· 973 973 974 974 void dlm_create_debug_file(struct dlm_ls *ls) 975 975 { 976 - char name[DLM_LOCKSPACE_LEN + 8]; 976 + /* Reserve enough space for the longest file name */ 977 + char name[DLM_LOCKSPACE_LEN + sizeof("_queued_asts")]; 977 978 978 979 /* format 1 */ 979 980 ··· 986 985 987 986 /* format 2 */ 988 987 989 - memset(name, 0, sizeof(name)); 990 - snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_locks", ls->ls_name); 988 + snprintf(name, sizeof(name), "%s_locks", ls->ls_name); 991 989 992 990 ls->ls_debug_locks_dentry = debugfs_create_file(name, 993 991 0644, ··· 996 996 997 997 /* format 3 */ 998 998 999 - memset(name, 0, sizeof(name)); 1000 - snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_all", ls->ls_name); 999 + snprintf(name, sizeof(name), "%s_all", ls->ls_name); 1001 1000 1002 1001 ls->ls_debug_all_dentry = debugfs_create_file(name, 1003 1002 S_IFREG | S_IRUGO, ··· 1006 1007 1007 1008 /* format 4 */ 1008 1009 1009 - memset(name, 0, sizeof(name)); 1010 - snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_toss", ls->ls_name); 1010 + snprintf(name, sizeof(name), "%s_toss", ls->ls_name); 1011 1011 1012 1012 ls->ls_debug_toss_dentry = debugfs_create_file(name, 1013 1013 S_IFREG | S_IRUGO, ··· 1014 1016 ls, 1015 1017 &format4_fops); 1016 1018 1017 - memset(name, 0, sizeof(name)); 1018 - snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); 1019 + snprintf(name, sizeof(name), "%s_waiters", ls->ls_name); 1019 1020 1020 1021 ls->ls_debug_waiters_dentry = debugfs_create_file(name, 1021 1022 0644, ··· 1024 1027 1025 1028 /* format 5 */ 1026 1029 1027 - memset(name, 0, sizeof(name)); 1028 - snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_queued_asts", ls->ls_name); 1030 + snprintf(name, sizeof(name), "%s_queued_asts", ls->ls_name); 1029 1031 1030 1032 ls->ls_debug_queued_asts_dentry = debugfs_create_file(name, 1031 1033 0644,
+12
fs/dlm/lowcomms.c
··· 63 63 #include "config.h" 64 64 65 65 #define DLM_SHUTDOWN_WAIT_TIMEOUT msecs_to_jiffies(5000) 66 + #define DLM_MAX_PROCESS_BUFFERS 24 66 67 #define NEEDED_RMEM (4*1024*1024) 67 68 68 69 struct connection { ··· 195 194 #define DLM_IO_END 1 196 195 #define DLM_IO_EOF 2 197 196 #define DLM_IO_RESCHED 3 197 + #define DLM_IO_FLUSH 4 198 198 199 199 static void process_recv_sockets(struct work_struct *work); 200 200 static void process_send_sockets(struct work_struct *work); ··· 204 202 static DECLARE_WORK(process_work, process_dlm_messages); 205 203 static DEFINE_SPINLOCK(processqueue_lock); 206 204 static bool process_dlm_messages_pending; 205 + static atomic_t processqueue_count; 207 206 static LIST_HEAD(processqueue); 208 207 209 208 bool dlm_lowcomms_is_running(void) ··· 877 874 } 878 875 879 876 list_del(&pentry->list); 877 + atomic_dec(&processqueue_count); 880 878 spin_unlock(&processqueue_lock); 881 879 882 880 for (;;) { ··· 895 891 } 896 892 897 893 list_del(&pentry->list); 894 + atomic_dec(&processqueue_count); 898 895 spin_unlock(&processqueue_lock); 899 896 } 900 897 } ··· 967 962 con->rx_leftover); 968 963 969 964 spin_lock(&processqueue_lock); 965 + ret = atomic_inc_return(&processqueue_count); 970 966 list_add_tail(&pentry->list, &processqueue); 971 967 if (!process_dlm_messages_pending) { 972 968 process_dlm_messages_pending = true; 973 969 queue_work(process_workqueue, &process_work); 974 970 } 975 971 spin_unlock(&processqueue_lock); 972 + 973 + if (ret > DLM_MAX_PROCESS_BUFFERS) 974 + return DLM_IO_FLUSH; 976 975 977 976 return DLM_IO_SUCCESS; 978 977 } ··· 1512 1503 wake_up(&con->shutdown_wait); 1513 1504 /* CF_RECV_PENDING cleared */ 1514 1505 break; 1506 + case DLM_IO_FLUSH: 1507 + flush_workqueue(process_workqueue); 1508 + fallthrough; 1515 1509 case DLM_IO_RESCHED: 1516 1510 cond_resched(); 1517 1511 queue_work(io_workqueue, &con->rwork);
+32 -7
fs/dlm/midcomms.c
··· 337 337 338 338 int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr, int len) 339 339 { 340 - int ret, r = nodeid_hash(nodeid); 340 + int ret, idx, r = nodeid_hash(nodeid); 341 341 struct midcomms_node *node; 342 342 343 343 ret = dlm_lowcomms_addr(nodeid, addr, len); 344 344 if (ret) 345 345 return ret; 346 + 347 + idx = srcu_read_lock(&nodes_srcu); 348 + node = __find_node(nodeid, r); 349 + if (node) { 350 + srcu_read_unlock(&nodes_srcu, idx); 351 + return 0; 352 + } 353 + srcu_read_unlock(&nodes_srcu, idx); 346 354 347 355 node = kmalloc(sizeof(*node), GFP_NOFS); 348 356 if (!node) ··· 1038 1030 1039 1031 break; 1040 1032 case DLM_VERSION_3_2: 1033 + /* send ack back if necessary */ 1034 + dlm_send_ack_threshold(node, DLM_SEND_ACK_BACK_MSG_THRESHOLD); 1035 + 1041 1036 msg = dlm_midcomms_get_msg_3_2(mh, nodeid, len, allocation, 1042 1037 ppc); 1043 1038 if (!msg) { 1044 1039 dlm_free_mhandle(mh); 1045 1040 goto err; 1046 1041 } 1047 - 1048 - /* send ack back if necessary */ 1049 - dlm_send_ack_threshold(node, DLM_SEND_ACK_BACK_MSG_THRESHOLD); 1050 1042 break; 1051 1043 default: 1052 1044 dlm_free_mhandle(mh); ··· 1268 1260 1269 1261 idx = srcu_read_lock(&nodes_srcu); 1270 1262 node = nodeid2node(nodeid); 1271 - if (WARN_ON_ONCE(!node)) { 1263 + /* in case of dlm_midcomms_close() removes node */ 1264 + if (!node) { 1272 1265 srcu_read_unlock(&nodes_srcu, idx); 1273 1266 return; 1274 1267 } 1275 1268 1276 1269 spin_lock(&node->state_lock); 1270 + /* case of dlm_midcomms_addr() created node but 1271 + * was not added before because dlm_midcomms_close() 1272 + * removed the node 1273 + */ 1274 + if (!node->users) { 1275 + spin_unlock(&node->state_lock); 1276 + srcu_read_unlock(&nodes_srcu, idx); 1277 + return; 1278 + } 1279 + 1277 1280 node->users--; 1278 1281 pr_debug("node %d users dec count %d\n", nodeid, node->users); 1279 1282 ··· 1405 1386 midcomms_shutdown(node); 1406 1387 } 1407 1388 } 1408 - srcu_read_unlock(&nodes_srcu, idx); 1409 - mutex_unlock(&close_lock); 1410 1389 1411 1390 dlm_lowcomms_shutdown(); 1391 + 1392 + for (i = 0; i < CONN_HASH_SIZE; i++) { 1393 + hlist_for_each_entry_rcu(node, &node_hash[i], hlist) { 1394 + midcomms_node_reset(node); 1395 + } 1396 + } 1397 + srcu_read_unlock(&nodes_srcu, idx); 1398 + mutex_unlock(&close_lock); 1412 1399 } 1413 1400 1414 1401 int dlm_midcomms_close(int nodeid)