]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/clock.c
Update bcachefs sources to 841a95c29f4c bcachefs: fix userspace build errors
[bcachefs-tools-debian] / libbcachefs / clock.c
index c36bfc627a985d68213cceb9f8f0b1f4cb5c5e2b..f41889093a2c7eacaa1723667fc7bb2af5d0f3aa 100644 (file)
@@ -95,6 +95,7 @@ void bch2_kthread_io_clock_wait(struct io_clock *clock,
                                unsigned long io_until,
                                unsigned long cpu_timeout)
 {
+       bool kthread = (current->flags & PF_KTHREAD) != 0;
        struct io_clock_wait wait;
 
        wait.io_timer.expire    = io_until;
@@ -110,7 +111,7 @@ void bch2_kthread_io_clock_wait(struct io_clock *clock,
 
        while (1) {
                set_current_state(TASK_INTERRUPTIBLE);
-               if (kthread_should_stop())
+               if (kthread && kthread_should_stop())
                        break;
 
                if (wait.expired)