[Question] About IO timeout and hang

From: Feng Li
Date: Mon Jul 20 2020 - 06:53:10 EST


Hi Experts,

Consider accessing a "bad" disk, if the user process submits a
'read/write' request to the kernel through libaio,
and the kernel doesn't return the IO, because the underlay disk is
bad, and IO is stuck for a long time.

When the IO is a 'read', the user-space process has its own timeout
policy, and find this IO has timeout-ed, then is it safe
to free the io buffer before IO error return?
If the user-space doesn't free the buffer and use this buffer as
another read request, for example, read from another health disk,
and if at this time the bad disk response the IO,
will the buffer be corrupted by the before 'read' request?

Could anyone help me clarify this concern?

Thanks in advance.