Initialise mid_q_entry before putting it on the pending queue
authorSachin Prabhu <sprabhu@redhat.com>
Wed, 11 Jul 2012 11:28:05 +0000 (12:28 +0100)
committerSteve French <smfrench@gmail.com>
Tue, 17 Jul 2012 04:57:02 +0000 (23:57 -0500)
commitffc61ccbb96809df8d97ed609ac86b509eaf9056
tree6f97d985c640d7881aeb6ae888359e1c73213a1a
parent055c9fa8874fa7261eec7a268366565db84af474
Initialise mid_q_entry before putting it on the pending queue

A user reported a crash in cifs_demultiplex_thread() caused by an
incorrectly set mid_q_entry->callback() function. It appears that the
callback assignment made in cifs_call_async() was not flushed back to
memory suggesting that a memory barrier was required here. Changing the
code to make sure that the mid_q_entry structure was completely
initialised before it was added to the pending queue fixes the problem.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/transport.c