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-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

+18 -36
+8 -8
fs/dlm/config.c
··· 324 324 struct list_head list; /* space->members_gone */ 325 325 }; 326 326 327 - static struct configfs_group_operations clusters_ops = { 327 + static const struct configfs_group_operations clusters_ops = { 328 328 .make_group = make_cluster, 329 329 .drop_item = drop_cluster, 330 330 }; 331 331 332 - static struct configfs_item_operations cluster_ops = { 332 + static const struct configfs_item_operations cluster_ops = { 333 333 .release = release_cluster, 334 334 }; 335 335 336 - static struct configfs_group_operations spaces_ops = { 336 + static const struct configfs_group_operations spaces_ops = { 337 337 .make_group = make_space, 338 338 .drop_item = drop_space, 339 339 }; 340 340 341 - static struct configfs_item_operations space_ops = { 341 + static const struct configfs_item_operations space_ops = { 342 342 .release = release_space, 343 343 }; 344 344 345 - static struct configfs_group_operations comms_ops = { 345 + static const struct configfs_group_operations comms_ops = { 346 346 .make_item = make_comm, 347 347 .drop_item = drop_comm, 348 348 }; 349 349 350 - static struct configfs_item_operations comm_ops = { 350 + static const struct configfs_item_operations comm_ops = { 351 351 .release = release_comm, 352 352 }; 353 353 354 - static struct configfs_group_operations nodes_ops = { 354 + static const struct configfs_group_operations nodes_ops = { 355 355 .make_item = make_node, 356 356 .drop_item = drop_node, 357 357 }; 358 358 359 - static struct configfs_item_operations node_ops = { 359 + static const struct configfs_item_operations node_ops = { 360 360 .release = release_node, 361 361 }; 362 362
+3 -3
fs/dlm/dir.c
··· 62 62 char *b, *last_name = NULL; 63 63 int error = -ENOMEM, last_len, nodeid, result; 64 64 uint16_t namelen; 65 - unsigned int count = 0, count_match = 0, count_bad = 0, count_add = 0; 65 + unsigned int count = 0, count_bad = 0, count_add = 0; 66 66 67 67 log_rinfo(ls, "dlm_recover_directory"); 68 68 ··· 157 157 } 158 158 159 159 /* The name was found in rsbtbl, and the 160 - * master nodeid matches memb->nodeid. */ 160 + * master nodeid matches memb->nodeid. 161 161 162 162 if (result == DLM_LU_MATCH && 163 163 nodeid == memb->nodeid) { 164 164 count_match++; 165 - } 165 + }*/ 166 166 167 167 /* The name was not found in rsbtbl and was 168 168 * added with memb->nodeid as the master. */
+3 -1
fs/dlm/dlm_internal.h
··· 606 606 607 607 struct dlm_rsb ls_local_rsb; /* for returning errors */ 608 608 struct dlm_lkb ls_local_lkb; /* for returning errors */ 609 - struct dlm_message ls_local_ms; /* for faking a reply */ 610 609 611 610 struct dentry *ls_debug_rsb_dentry; /* debugfs */ 612 611 struct dentry *ls_debug_waiters_dentry; /* debugfs */ ··· 664 665 665 666 int ls_namelen; 666 667 char ls_name[DLM_LOCKSPACE_LEN + 1]; 668 + 669 + /* Must be last --ends in a flexible-array member.*/ 670 + struct dlm_message ls_local_ms; /* for faking a reply */ 667 671 }; 668 672 669 673 /*
+3 -19
fs/dlm/lock.c
··· 626 626 struct dlm_rsb **r_ret) 627 627 { 628 628 char key[DLM_RESNAME_MAXLEN] = {}; 629 - 629 + if (len > DLM_RESNAME_MAXLEN) 630 + return -EINVAL; 630 631 memcpy(key, name, len); 631 632 *r_ret = rhashtable_lookup_fast(rhash, &key, dlm_rhash_rsb_params); 632 633 if (*r_ret) ··· 5015 5014 static void recover_convert_waiter(struct dlm_ls *ls, struct dlm_lkb *lkb, 5016 5015 struct dlm_message *ms_local) 5017 5016 { 5018 - if (middle_conversion(lkb)) { 5019 - log_rinfo(ls, "%s %x middle convert in progress", __func__, 5020 - lkb->lkb_id); 5021 - 5022 - /* We sent this lock to the new master. The new master will 5023 - * tell us when it's granted. We no longer need a reply, so 5024 - * use a fake reply to put the lkb into the right state. 5025 - */ 5026 - hold_lkb(lkb); 5027 - memset(ms_local, 0, sizeof(struct dlm_message)); 5028 - ms_local->m_type = cpu_to_le32(DLM_MSG_CONVERT_REPLY); 5029 - ms_local->m_result = cpu_to_le32(to_dlm_errno(-EINPROGRESS)); 5030 - ms_local->m_header.h_nodeid = cpu_to_le32(lkb->lkb_nodeid); 5031 - _receive_convert_reply(lkb, ms_local, true); 5032 - unhold_lkb(lkb); 5033 - 5034 - } else if (lkb->lkb_rqmode >= lkb->lkb_grmode) { 5017 + if (middle_conversion(lkb) || lkb->lkb_rqmode >= lkb->lkb_grmode) 5035 5018 set_bit(DLM_IFL_RESEND_BIT, &lkb->lkb_iflags); 5036 - } 5037 5019 5038 5020 /* lkb->lkb_rqmode < lkb->lkb_grmode shouldn't happen since down 5039 5021 conversions are async; there's no reply from the remote master */
+1 -5
fs/dlm/member.c
··· 299 299 if (!memb) 300 300 list_add_tail(newlist, head); 301 301 else { 302 - /* FIXME: can use list macro here */ 303 - newlist->prev = tmp->prev; 304 - newlist->next = tmp; 305 - tmp->prev->next = newlist; 306 - tmp->prev = newlist; 302 + list_add_tail(newlist, tmp); 307 303 } 308 304 } 309 305