Skip to content

Commit

Permalink
libublk: call pctl(PR_SET_IO_FLUSHER) in UblkQueue context
Browse files Browse the repository at this point in the history
Call pctl(PR_SET_IO_FLUSHER) in UblkQueue context for avoiding potential
memory deadlock.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
  • Loading branch information
ming1 committed Oct 14, 2023
1 parent ad7f082 commit 8364e4b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ impl UblkSession {
}
_tx.send((q, unsafe { libc::gettid() })).unwrap();

unsafe {
const PR_SET_IO_FLUSHER: i32 = 57; //include/uapi/linux/prctl.h
libc::prctl(PR_SET_IO_FLUSHER, 0, 0, 0, 0);
};

_q_fn(q, &_dev);
}));
}
Expand Down

0 comments on commit 8364e4b

Please sign in to comment.