Update uds_join_threads to delay in wait_for_completion_interruptible
loop. And cleanup style nits in perform_admin_operation().
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
* Using the "interruptible" interface means that Linux will not log a message when we wait
* for more than 120 seconds.
*/
- while (wait_for_completion_interruptible(&admin->callback_sync) != 0)
- /* * However, if we get a signal in a user-mode process, we could spin... */
+ while (wait_for_completion_interruptible(&admin->callback_sync)) {
+ /* However, if we get a signal in a user-mode process, we could spin... */
fsleep(1000);
+ }
result = admin->completion.result;
/* pairs with implicit barrier in cmpxchg above */
#include "uds-threads.h"
#include <linux/completion.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/kthread.h>
#include <linux/sched.h>
int uds_join_threads(struct thread *thread)
{
- while (wait_for_completion_interruptible(&thread->thread_done) != 0)
- /* empty loop */
- ;
+ while (wait_for_completion_interruptible(&thread->thread_done))
+ fsleep(1000);
mutex_lock(&thread_mutex);
hlist_del(&thread->thread_links);