![]() ![]() Please provide your feedback on the suggestion. Void _list_del_entry(struct list_head *entry) So that it helps the user in catching the corruption, but also does ![]() Remove the "if" condition and "return" statement. In my humble opinion, the function _list_del_entry can be modified to Other notes, patches, fixes, workarounds: Version 3.0.15 (AOSP version from google) Keywords: list_debug, dpm_prepare, CONFIG_DEBUG_LIST Note that the example I mentioned is from AOSP, but the same scenarioĬan be encountered in mainline kernel as well. On whether CONFIG_DEBUG_LIST is defined or not. Whether the node is actually deleted or not.īasically the behavior of the function _list_del_entry changes based Here there is no way for the caller of _list_del_entry to know Now that since these two lists are merged, the sub-system breaks down. So if dpm_list is corrupted when moving one node from dpm_list toĭpm_prepared_list, we'll wrongly merge both the lists. Then the first call will not delete the node (Warning is thrown andīut the second call i.e list_add_tail would anyway add the node toĪnother list pointed by head (dpm_prepared_list). If the list in which &dev->power.entry lives (dpm_list) is corrupted Now the implementation of list_move_tail (include/linux/list.h) is as follows ![]() "list_del corruption, %p->prev is LIST_POISON2 (%p)\n", "list_del corruption, %p->next is LIST_POISON1 (%p)\n", So based on whether CONFIG_DEBUG_LIST is defined or not the behavior The node if the list it belongs to is corrupted. The function _list_del_entry implemented in include/linux/list.hĪlways removes the node from the list it belongs to.īut the same function implemented in lib/list_debug.c does not remove The _list_del_entry implemented in lib/list_debug.c does not The following is the Bug Report on list_debug.c implementation. Next in thread: Dave Jones: "Re: PROBLEM: _list_del_entry in lib/list_debug.c does not deletethe node if the list is corrupted".Previous message: Linus Walleij: "Re: ARM: ux500: Turn on the 'heartbeat' LED trigger".Next message: Linus Walleij: "Re: net/smsc911x: Provide common clock functionality".You can learn much more here, and also in this question.Linux-Kernel Archive: PROBLEM: _list_del_entry in lib/list_debug.c does not delete thenode if the list is corrupted PROBLEM: _list_del_entry in lib/list_debug.c does not delete thenode if the list is corrupted From: Shankar Brahadeeswaran Or, like the macro says: &temp = (typestruct *)((char *) &temp.j) - &((typestruct *)0)->j Hence, the subtraction is: &temp = (typestruct *)((char *) &temp.j) - offsetof(typestruct, j) The address of the pointer is: (typestruct *)((char *) &temp.j) ![]() To do that, we simple compute the address of the pointer minus the member position. Now we want to calculate the address of temp, where temp is typestruct temp. You can get the same result with the macro offsetof(typestruct, j) In this case, it is the sizeof(int), because j is just bellow int i So lets assume this expression values 4 for simplicity. So, it is the size, in bytes, from the zero memory casted to the type, to the member. So, for example, suppose you have the struct: typedef structįirst thing you need to know is that the last part of the macro: &((typestruct *)0)->j This macro is used to find the address of a struct given one of its member. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |