mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02:00
dlm for 7.0
This set includes several minor code cleanups, and one notable fix for recovery of in-progress lock conversions which would lead to a the convert operation never completing. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEcGkeEvkvjdvlR90nOBtzx/yAaaoFAmmKHCYACgkQOBtzx/yA aaqs3A//S56SyJ652KSl5RaVQq6o5evap/jJiHx9/aB5xzOvJ30HRJeaZxtEjFB8 SpC1IspbDYA+NJa95KSwdZzfJRQSn04abBCZVb+J+/BnrkN0cwCaftK5iVIx+fBp hMhDmi/61oZjgUBjn7hZgSq7JeJlUHjhnqEcZXYMoHm9nYCJhILUDc0Bs5aTeqZW l9seDcAsam8BBRst8pNlH7ONdzsVxkYst5AaCcS6qhJvKRACKX/teTPM/lNkdgT7 m2s/0sSitNSKpUA0ve8NYkfhwBhvN58eI3nMBSnfzMi8mHxZs33elBTA/uvhNad8 cPbU7pQDg/H6tzkcfzKZPzy+R2MLxjELcplimWlAe7S+n1Geq1qN8ByWqE3L//3F F/e0RmoIEFe86ONc2UuSGgzdOMxBuIAvbpg2Z62SRx+xbKquavNbknAURobUQenA FIa1naXVnMhssaFTmWh0G9NN11aKzmjdwv6UEiz+ofBUJlO3MnCfO96B6XT8gQKE W1bNlT2nGdiXdNm3WLlrIcX7HjKyp3YkE7UdfiT9+qCFiA98FxiLnit2p3AkELry jEpAb7/jcjpsvvluBlqmZlmLomwdkh5BN13FZPG4Ww69Q8OpGOEo71UbuyRU5ux5 1oXsnxfj7o0+4B6zhV2Y/4WFbzctcVd5H3zyZyyZXjRSipXL9S4= =/POz -----END PGP SIGNATURE----- Merge tag 'dlm-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This includes several minor code cleanups, and one notable fix for recovery of in-progress lock conversions which would lead to a the convert operation never completing" * tag 'dlm-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: dlm: Avoid -Wflex-array-member-not-at-end warning fs/dlm/dir: remove unuse variable count_match dlm: Constify struct configfs_item_operations and configfs_group_operations fs/dlm: use list_add_tail() instead of open-coding list insertion dlm: validate length in dlm_search_rsb_tree dlm: fix recovery pending middle conversion
This commit is contained in:
commit
af23fd93fc
|
|
@ -324,39 +324,39 @@ struct dlm_member_gone {
|
|||
struct list_head list; /* space->members_gone */
|
||||
};
|
||||
|
||||
static struct configfs_group_operations clusters_ops = {
|
||||
static const struct configfs_group_operations clusters_ops = {
|
||||
.make_group = make_cluster,
|
||||
.drop_item = drop_cluster,
|
||||
};
|
||||
|
||||
static struct configfs_item_operations cluster_ops = {
|
||||
static const struct configfs_item_operations cluster_ops = {
|
||||
.release = release_cluster,
|
||||
};
|
||||
|
||||
static struct configfs_group_operations spaces_ops = {
|
||||
static const struct configfs_group_operations spaces_ops = {
|
||||
.make_group = make_space,
|
||||
.drop_item = drop_space,
|
||||
};
|
||||
|
||||
static struct configfs_item_operations space_ops = {
|
||||
static const struct configfs_item_operations space_ops = {
|
||||
.release = release_space,
|
||||
};
|
||||
|
||||
static struct configfs_group_operations comms_ops = {
|
||||
static const struct configfs_group_operations comms_ops = {
|
||||
.make_item = make_comm,
|
||||
.drop_item = drop_comm,
|
||||
};
|
||||
|
||||
static struct configfs_item_operations comm_ops = {
|
||||
static const struct configfs_item_operations comm_ops = {
|
||||
.release = release_comm,
|
||||
};
|
||||
|
||||
static struct configfs_group_operations nodes_ops = {
|
||||
static const struct configfs_group_operations nodes_ops = {
|
||||
.make_item = make_node,
|
||||
.drop_item = drop_node,
|
||||
};
|
||||
|
||||
static struct configfs_item_operations node_ops = {
|
||||
static const struct configfs_item_operations node_ops = {
|
||||
.release = release_node,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq)
|
|||
char *b, *last_name = NULL;
|
||||
int error = -ENOMEM, last_len, nodeid, result;
|
||||
uint16_t namelen;
|
||||
unsigned int count = 0, count_match = 0, count_bad = 0, count_add = 0;
|
||||
unsigned int count = 0, count_bad = 0, count_add = 0;
|
||||
|
||||
log_rinfo(ls, "dlm_recover_directory");
|
||||
|
||||
|
|
@ -157,12 +157,12 @@ int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq)
|
|||
}
|
||||
|
||||
/* The name was found in rsbtbl, and the
|
||||
* master nodeid matches memb->nodeid. */
|
||||
* master nodeid matches memb->nodeid.
|
||||
|
||||
if (result == DLM_LU_MATCH &&
|
||||
nodeid == memb->nodeid) {
|
||||
count_match++;
|
||||
}
|
||||
}*/
|
||||
|
||||
/* The name was not found in rsbtbl and was
|
||||
* added with memb->nodeid as the master. */
|
||||
|
|
|
|||
|
|
@ -606,7 +606,6 @@ struct dlm_ls {
|
|||
|
||||
struct dlm_rsb ls_local_rsb; /* for returning errors */
|
||||
struct dlm_lkb ls_local_lkb; /* for returning errors */
|
||||
struct dlm_message ls_local_ms; /* for faking a reply */
|
||||
|
||||
struct dentry *ls_debug_rsb_dentry; /* debugfs */
|
||||
struct dentry *ls_debug_waiters_dentry; /* debugfs */
|
||||
|
|
@ -665,6 +664,9 @@ struct dlm_ls {
|
|||
|
||||
int ls_namelen;
|
||||
char ls_name[DLM_LOCKSPACE_LEN + 1];
|
||||
|
||||
/* Must be last --ends in a flexible-array member.*/
|
||||
struct dlm_message ls_local_ms; /* for faking a reply */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -626,7 +626,8 @@ int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name, int len,
|
|||
struct dlm_rsb **r_ret)
|
||||
{
|
||||
char key[DLM_RESNAME_MAXLEN] = {};
|
||||
|
||||
if (len > DLM_RESNAME_MAXLEN)
|
||||
return -EINVAL;
|
||||
memcpy(key, name, len);
|
||||
*r_ret = rhashtable_lookup_fast(rhash, &key, dlm_rhash_rsb_params);
|
||||
if (*r_ret)
|
||||
|
|
@ -5014,25 +5015,8 @@ void dlm_receive_buffer(const union dlm_packet *p, int nodeid)
|
|||
static void recover_convert_waiter(struct dlm_ls *ls, struct dlm_lkb *lkb,
|
||||
struct dlm_message *ms_local)
|
||||
{
|
||||
if (middle_conversion(lkb)) {
|
||||
log_rinfo(ls, "%s %x middle convert in progress", __func__,
|
||||
lkb->lkb_id);
|
||||
|
||||
/* We sent this lock to the new master. The new master will
|
||||
* tell us when it's granted. We no longer need a reply, so
|
||||
* use a fake reply to put the lkb into the right state.
|
||||
*/
|
||||
hold_lkb(lkb);
|
||||
memset(ms_local, 0, sizeof(struct dlm_message));
|
||||
ms_local->m_type = cpu_to_le32(DLM_MSG_CONVERT_REPLY);
|
||||
ms_local->m_result = cpu_to_le32(to_dlm_errno(-EINPROGRESS));
|
||||
ms_local->m_header.h_nodeid = cpu_to_le32(lkb->lkb_nodeid);
|
||||
_receive_convert_reply(lkb, ms_local, true);
|
||||
unhold_lkb(lkb);
|
||||
|
||||
} else if (lkb->lkb_rqmode >= lkb->lkb_grmode) {
|
||||
if (middle_conversion(lkb) || lkb->lkb_rqmode >= lkb->lkb_grmode)
|
||||
set_bit(DLM_IFL_RESEND_BIT, &lkb->lkb_iflags);
|
||||
}
|
||||
|
||||
/* lkb->lkb_rqmode < lkb->lkb_grmode shouldn't happen since down
|
||||
conversions are async; there's no reply from the remote master */
|
||||
|
|
|
|||
|
|
@ -299,11 +299,7 @@ static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new)
|
|||
if (!memb)
|
||||
list_add_tail(newlist, head);
|
||||
else {
|
||||
/* FIXME: can use list macro here */
|
||||
newlist->prev = tmp->prev;
|
||||
newlist->next = tmp;
|
||||
tmp->prev->next = newlist;
|
||||
tmp->prev = newlist;
|
||||
list_add_tail(newlist, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user