On Sun, Mar 23, 2008 at 11:52 PM, Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> wrote: > On Sun, 23 Mar 2008, Manish Katiyar wrote: > > > > On Sun, Mar 23, 2008 at 11:35 PM, Manish Katiyar <mkatiyar@xxxxxxxxx> wrote: > > > > > Hmmm.... after seeing the list_del(), I was wondering if after > > > splicing the list, what seems to be more reasonable. > > > > > > Setting the prev and next pointers of head to NULL, or setting > > > them to LIST_POISON1 and LIST_POISON2 as these two seem to be the > > > ideal candidate as they are made to notify(tracked easliy) in case > > > of illegal access of list pointers. > > > > > > Robert your thoughts/comments ?? > > > > Following the footsteps of list_del() and list_del_init(), i think > > we should have > > > > static inline void list_splice(struct list_head *list, struct list_head *head) > > { > > if (!list_empty(list)){ > > __list_splice(list, head); > > list->next = LIST_POISON1; > > list->prev = LIST_POISON2; > > } > > } > > > > as the default behaviour of list_splice() > > that *would* seem to be more consistent behaviour, but it's still not > clear what the point is of that link poisoning in the first place. I might be completely wrong as this is just my guess. I think link poisoning would help in debugging, when from the illegal pointer access itself you can say that whether you tried to access a list_head which you never intialized ( in case of NULL) or similar kind of thing or you tried to access a list_head (in case of LIST_POISON{1,2}) which was part of a list at some point of time and probably should go back to check the code to see if there is any logical error in the code which is trying to access the element after removing it from list. Makes sense ?? or I am talking utter nonsense :-) ??? > > > > rday > -- > > ======================================================================== > Robert P. J. Day > Linux Consulting, Training and Annoying Kernel Pedantry: > Have classroom, will lecture. > > http://crashcourse.ca Waterloo, Ontario, CANADA > ======================================================================== > -- Thanks & Regards, ******************************************** Manish Katiyar ( http://mkatiyar.googlepages.com ) 3rd Floor, Fair Winds Block EGL Software Park Off Intermediate Ring Road Bangalore 560071, India *********************************************** -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ