aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2024-02-14 10:25:39 -0500
committerMike Snitzer <snitzer@kernel.org>2024-02-20 13:43:19 -0500
commitcae3816d9933dc8041e1f3e14f10df34707f0b06 (patch)
treebc2732bc98992f27c0ddcc71510ef20a1585037f /drivers/md
parent5581a43d302fb860f88f649c1a48a1c65c566eb0 (diff)
downloadlinux-cae3816d9933dc8041e1f3e14f10df34707f0b06.tar.gz
dm vdo: tweak wait_for_completion_interruptible callers
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/dm-vdo-target.c5
-rw-r--r--drivers/md/dm-vdo/uds-threads.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/dm-vdo/dm-vdo-target.c b/drivers/md/dm-vdo/dm-vdo-target.c
index e2e60a29e873e..e754b9e30cab5 100644
--- a/drivers/md/dm-vdo/dm-vdo-target.c
+++ b/drivers/md/dm-vdo/dm-vdo-target.c
@@ -1235,9 +1235,10 @@ static int perform_admin_operation(struct vdo *vdo, u32 starting_phase,
* 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 */
diff --git a/drivers/md/dm-vdo/uds-threads.c b/drivers/md/dm-vdo/uds-threads.c
index e7524617f9f87..769c783e342a2 100644
--- a/drivers/md/dm-vdo/uds-threads.c
+++ b/drivers/md/dm-vdo/uds-threads.c
@@ -6,6 +6,7 @@
#include "uds-threads.h"
#include <linux/completion.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/kthread.h>
#include <linux/sched.h>
@@ -125,9 +126,8 @@ int uds_create_thread(void (*thread_function)(void *), void *thread_data,
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);