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

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

Pull dlm updates from David Teigland:

- Fix a case where the new scanning code missed removing an unused rsb

- Fix the error when removing a configfs entry for an invalid node id

* tag 'dlm-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
dlm: return -ENOENT if no comm was found
dlm: fix srcu_read_lock() return type to int
dlm: fix removal of rsb struct that is master and dir record

+33 -18
+1 -1
fs/dlm/config.c
··· 935 935 mutex_unlock(&clusters_root.subsys.su_mutex); 936 936 } 937 937 if (!cm) 938 - return -EEXIST; 938 + return -ENOENT; 939 939 940 940 *seq = cm->seq; 941 941 put_comm(cm);
+30 -16
fs/dlm/lock.c
··· 824 824 r->res_first_lkid = 0; 825 825 } 826 826 827 - /* A dir record will not be on the scan list. */ 828 - if (r->res_dir_nodeid != our_nodeid) 829 - del_scan(ls, r); 827 + /* we always deactivate scan timer for the rsb, when 828 + * we move it out of the inactive state as rsb state 829 + * can be changed and scan timers are only for inactive 830 + * rsbs. 831 + */ 832 + del_scan(ls, r); 830 833 list_move(&r->res_slow_list, &ls->ls_slow_active); 831 834 rsb_clear_flag(r, RSB_INACTIVE); 832 835 kref_init(&r->res_ref); /* ref is now used in active state */ ··· 992 989 r->res_nodeid = 0; 993 990 } 994 991 992 + del_scan(ls, r); 995 993 list_move(&r->res_slow_list, &ls->ls_slow_active); 996 994 rsb_clear_flag(r, RSB_INACTIVE); 997 995 kref_init(&r->res_ref); 998 - del_scan(ls, r); 999 996 write_unlock_bh(&ls->ls_rsbtbl_lock); 1000 997 1001 998 goto out; ··· 1340 1337 __dlm_master_lookup(ls, r, our_nodeid, from_nodeid, true, flags, 1341 1338 r_nodeid, result); 1342 1339 1343 - /* A dir record rsb should never be on scan list. */ 1344 - /* Try to fix this with del_scan? */ 1345 - WARN_ON(!list_empty(&r->res_scan_list)); 1340 + /* A dir record rsb should never be on scan list. 1341 + * Except when we are the dir and master node. 1342 + * This function should only be called by the dir 1343 + * node. 1344 + */ 1345 + WARN_ON(!list_empty(&r->res_scan_list) && 1346 + r->res_master_nodeid != our_nodeid); 1346 1347 1347 1348 write_unlock_bh(&ls->ls_rsbtbl_lock); 1348 1349 ··· 1437 1430 list_move(&r->res_slow_list, &ls->ls_slow_inactive); 1438 1431 1439 1432 /* 1440 - * When the rsb becomes unused: 1441 - * - If it's not a dir record for a remote master rsb, 1442 - * then it is put on the scan list to be freed. 1443 - * - If it's a dir record for a remote master rsb, 1444 - * then it is kept in the inactive state until 1445 - * receive_remove() from the master node. 1433 + * When the rsb becomes unused, there are two possibilities: 1434 + * 1. Leave the inactive rsb in place (don't remove it). 1435 + * 2. Add it to the scan list to be removed. 1436 + * 1437 + * 1 is done when the rsb is acting as the dir record 1438 + * for a remotely mastered rsb. The rsb must be left 1439 + * in place as an inactive rsb to act as the dir record. 1440 + * 1441 + * 2 is done when a) the rsb is not the master and not the 1442 + * dir record, b) when the rsb is both the master and the 1443 + * dir record, c) when the rsb is master but not dir record. 1444 + * 1445 + * (If no directory is used, the rsb can always be removed.) 1446 1446 */ 1447 - if (!dlm_no_directory(ls) && 1448 - (r->res_master_nodeid != our_nodeid) && 1449 - (dlm_dir_nodeid(r) != our_nodeid)) 1447 + if (dlm_no_directory(ls) || 1448 + (r->res_master_nodeid == our_nodeid || 1449 + dlm_dir_nodeid(r) != our_nodeid)) 1450 1450 add_scan(ls, r); 1451 1451 1452 1452 if (r->res_lvbptr) {
+2 -1
fs/dlm/lowcomms.c
··· 462 462 int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr) 463 463 { 464 464 struct connection *con; 465 - bool ret, idx; 465 + bool ret; 466 + int idx; 466 467 467 468 idx = srcu_read_lock(&connections_srcu); 468 469 con = nodeid2con(nodeid, GFP_NOFS);