mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
scst_vdisk: Fix blockio_exec_rw() error path
Send back a BUSY response if not enough memory is available to process a read or write request. Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -3699,6 +3699,16 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua)
|
||||
if (blockio_work == NULL)
|
||||
goto out_no_mem;
|
||||
|
||||
#if 0
|
||||
{
|
||||
static int err_inj_cntr;
|
||||
if (++err_inj_cntr % 256 == 0) {
|
||||
PRINT_INFO("blockio_exec_rw() error injection");
|
||||
goto out_no_bio;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
blockio_work->cmd = cmd;
|
||||
|
||||
if (q)
|
||||
@@ -3829,6 +3839,8 @@ out_no_bio:
|
||||
|
||||
out_no_mem:
|
||||
scst_set_busy(cmd);
|
||||
cmd->completed = 1;
|
||||
cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user