提交 2ef82d24 编写于 作者: D Dexuan Cui 提交者: Greg Kroah-Hartman

Drivers: hv: hv_fcopy: fix a race condition for SMP guest

We should schedule the 5s "timer work" before starting the data transfer,
otherwise, the data transfer code may finish so fast on another
virtual cpu that when the code(fcopy_write()) trying to cancel the 5s
"timer work" can occasionally fail because the "timer work" may haven't
been scheduled yet and as a result the fcopy process will be aborted
wrongly by fcopy_work_func() in 5s.

Thank Liz Zhang <lizzha@microsoft.com> for the initial investigation
on the bug.

This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1118123Tested-by: NLiz Zhang <lizzha@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: NDexuan Cui <decui@microsoft.com>
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1795cd9b
...@@ -246,8 +246,8 @@ void hv_fcopy_onchannelcallback(void *context) ...@@ -246,8 +246,8 @@ void hv_fcopy_onchannelcallback(void *context)
/* /*
* Send the information to the user-level daemon. * Send the information to the user-level daemon.
*/ */
fcopy_send_data();
schedule_delayed_work(&fcopy_work, 5*HZ); schedule_delayed_work(&fcopy_work, 5*HZ);
fcopy_send_data();
return; return;
} }
icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE; icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册