mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 07:53:11 -05:00
dlm for 6.14
- 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. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEcGkeEvkvjdvlR90nOBtzx/yAaaoFAmeOi6EACgkQOBtzx/yA aaqLPRAApqsWLMdaOejBY3B2KfFeSGqi+hcYO5fpjRgFocRCnG3q2aY1+lNEemDd 8EEvFGDzqCvFKbS+VGWjQ+ABiA8Zro4nqjuc6vW/EHivNsWiAgSqeSwQSG81v7x1 Ht2EkVg9UK2rRYb0Y4Y46XIiGU7Yd9q+bpv1nLtjLsFM+u7j3hC1IrK5Rl71JSYE ozhHIVkg5VxxNHjr3isc7kChIdYdRIX+xZm+YfAfC3/Z9YHcJAQ436RNvW/rDjJX iR/td4Z04tACwZVu46TDjHaLS5jQ/Lk/7Vk+FrliuXjTTcNbxM+MTX0uoxKUDJ5D JD1bMaiFsIvvd146wGk022iRTSUE27KnFJaknvV1njuvY3+jHhV9uDehl8Vurv7b GS2ZNajUmU/5Mv9MtfxfZNsH5cKQPMKhyKugt5gZhPFLnhf6APEz6htyZ+Sbmueb 8LMycO9SiIDiwOowS8leR0qmfI9k/11vwmO2vi0fbDDCSPTL8wq12JWmg/S+YXAp HuKNfpnCE6s+c+EB3y50C1jOvbHQ1u96FpdHyUzv1hDrGG9/w5JG95codZcXQ314 uA4uEQBpan7TDLaSlSccSXUcRilrYZ3eY94wKHlRuBhLswsAGAZDz4HmuMm7VPeR etiZRhehQYdHZs/+Zr5k5sn+AI8yDZKzl+mw55SGeij7ti0sXzY= =fSW0 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
3d3a9c8b89
3 changed files with 33 additions and 18 deletions
|
@ -935,7 +935,7 @@ int dlm_comm_seq(int nodeid, uint32_t *seq, bool locked)
|
|||
mutex_unlock(&clusters_root.subsys.su_mutex);
|
||||
}
|
||||
if (!cm)
|
||||
return -EEXIST;
|
||||
return -ENOENT;
|
||||
|
||||
*seq = cm->seq;
|
||||
put_comm(cm);
|
||||
|
|
|
@ -824,9 +824,12 @@ static int find_rsb_dir(struct dlm_ls *ls, const void *name, int len,
|
|||
r->res_first_lkid = 0;
|
||||
}
|
||||
|
||||
/* A dir record will not be on the scan list. */
|
||||
if (r->res_dir_nodeid != our_nodeid)
|
||||
del_scan(ls, r);
|
||||
/* we always deactivate scan timer for the rsb, when
|
||||
* we move it out of the inactive state as rsb state
|
||||
* can be changed and scan timers are only for inactive
|
||||
* rsbs.
|
||||
*/
|
||||
del_scan(ls, r);
|
||||
list_move(&r->res_slow_list, &ls->ls_slow_active);
|
||||
rsb_clear_flag(r, RSB_INACTIVE);
|
||||
kref_init(&r->res_ref); /* ref is now used in active state */
|
||||
|
@ -989,10 +992,10 @@ static int find_rsb_nodir(struct dlm_ls *ls, const void *name, int len,
|
|||
r->res_nodeid = 0;
|
||||
}
|
||||
|
||||
del_scan(ls, r);
|
||||
list_move(&r->res_slow_list, &ls->ls_slow_active);
|
||||
rsb_clear_flag(r, RSB_INACTIVE);
|
||||
kref_init(&r->res_ref);
|
||||
del_scan(ls, r);
|
||||
write_unlock_bh(&ls->ls_rsbtbl_lock);
|
||||
|
||||
goto out;
|
||||
|
@ -1337,9 +1340,13 @@ static int _dlm_master_lookup(struct dlm_ls *ls, int from_nodeid, const char *na
|
|||
__dlm_master_lookup(ls, r, our_nodeid, from_nodeid, true, flags,
|
||||
r_nodeid, result);
|
||||
|
||||
/* A dir record rsb should never be on scan list. */
|
||||
/* Try to fix this with del_scan? */
|
||||
WARN_ON(!list_empty(&r->res_scan_list));
|
||||
/* A dir record rsb should never be on scan list.
|
||||
* Except when we are the dir and master node.
|
||||
* This function should only be called by the dir
|
||||
* node.
|
||||
*/
|
||||
WARN_ON(!list_empty(&r->res_scan_list) &&
|
||||
r->res_master_nodeid != our_nodeid);
|
||||
|
||||
write_unlock_bh(&ls->ls_rsbtbl_lock);
|
||||
|
||||
|
@ -1430,16 +1437,23 @@ static void deactivate_rsb(struct kref *kref)
|
|||
list_move(&r->res_slow_list, &ls->ls_slow_inactive);
|
||||
|
||||
/*
|
||||
* When the rsb becomes unused:
|
||||
* - If it's not a dir record for a remote master rsb,
|
||||
* then it is put on the scan list to be freed.
|
||||
* - If it's a dir record for a remote master rsb,
|
||||
* then it is kept in the inactive state until
|
||||
* receive_remove() from the master node.
|
||||
* When the rsb becomes unused, there are two possibilities:
|
||||
* 1. Leave the inactive rsb in place (don't remove it).
|
||||
* 2. Add it to the scan list to be removed.
|
||||
*
|
||||
* 1 is done when the rsb is acting as the dir record
|
||||
* for a remotely mastered rsb. The rsb must be left
|
||||
* in place as an inactive rsb to act as the dir record.
|
||||
*
|
||||
* 2 is done when a) the rsb is not the master and not the
|
||||
* dir record, b) when the rsb is both the master and the
|
||||
* dir record, c) when the rsb is master but not dir record.
|
||||
*
|
||||
* (If no directory is used, the rsb can always be removed.)
|
||||
*/
|
||||
if (!dlm_no_directory(ls) &&
|
||||
(r->res_master_nodeid != our_nodeid) &&
|
||||
(dlm_dir_nodeid(r) != our_nodeid))
|
||||
if (dlm_no_directory(ls) ||
|
||||
(r->res_master_nodeid == our_nodeid ||
|
||||
dlm_dir_nodeid(r) != our_nodeid))
|
||||
add_scan(ls, r);
|
||||
|
||||
if (r->res_lvbptr) {
|
||||
|
|
|
@ -462,7 +462,8 @@ static bool dlm_lowcomms_con_has_addr(const struct connection *con,
|
|||
int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr)
|
||||
{
|
||||
struct connection *con;
|
||||
bool ret, idx;
|
||||
bool ret;
|
||||
int idx;
|
||||
|
||||
idx = srcu_read_lock(&connections_srcu);
|
||||
con = nodeid2con(nodeid, GFP_NOFS);
|
||||
|
|
Loading…
Reference in a new issue