sys/vfs/fuse: Drop PCATCH from tsleep on waiting IPC completion
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 2 Apr 2019 15:30:11 +0000 (00:30 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 2 Apr 2019 15:55:46 +0000 (00:55 +0900)
Even with kern_sigprocmask(SIG_BLOCK) called prior to tsleep(9),
tsleep with PCATCH flag can still catch a signal (e.g. SIGINT) and
return 0 (not EINTR).

This is due to tsleep(9) setting "lp->lwp_flags |= LWP_SINTR;" before
going into sleep when PCATCH is specified.

When this happens, KKASSERT() after tsleep(9) can be false, so just
drop PCATCH.

sys/vfs/fuse/fuse_ipc.c

index a142677..62419ee 100644 (file)
@@ -166,10 +166,10 @@ fuse_ipc_wait(struct fuse_ipc *fip)
                return 0;
 again:
        fuse_block_sigs(&oldset);
-       error = tsleep(fip, PCATCH, "ftxp", 5 * hz);
+       error = tsleep(fip, 0, "ftxp", 5 * hz);
        fuse_restore_sigs(&oldset);
        if (!error)
-               KKASSERT(fuse_ipc_test_replied(fip)); /* XXX */
+               KKASSERT(fuse_ipc_test_replied(fip));
 
        if (error == EWOULDBLOCK) {
                if (!fuse_ipc_test_replied(fip)) {