PERSISTENT RESERVE IN: Suppress a kernel warning for small output buffer sizes

This patch suppresses the following error message and kernel warning:

scst: ***ERROR***: Too big response data len 24 (max 8), limiting it to the max (dev iis)
Call Trace:
 [<ffffffff818b1193>] ? dump_stack+0x41/0x56
 [<ffffffffa01c1a8f>] ? scst_set_resp_data_len+0x82/0xb1 [scst]
 [<ffffffffa01ca80f>] ? scst_pr_read_reservation+0xbf/0xc4 [scst]
 [<ffffffffa01b707b>] ? scst_persistent_reserve_in_local+0x140/0x1ce [scst]
 [<ffffffffa01b7cee>] ? scst_exec_check_blocking+0x57/0xf1 [scst]
 [<ffffffffa01b85f4>] ? scst_process_active_cmd+0x86c/0x136f [scst]
 [<ffffffffa01b913c>] ? scst_do_job_active+0x45/0x5b [scst]
 [<ffffffffa01b939c>] ? scst_cmd_thread+0x218/0x2b7 [scst]
 [<ffffffff8105292a>] ? wake_up_bit+0x23/0x23
 [<ffffffffa01b9184>] ? scst_cmd_tasklet+0x32/0x32 [scst]
 [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
 [<ffffffffa01b9184>] ? scst_cmd_tasklet+0x32/0x32 [scst]
 [<ffffffff81052400>] ? kthread+0xab/0xb3
 [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
 [<ffffffff818b4e3c>] ? ret_from_fork+0x7c/0xb0
 [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51

Reported-by: Roman Bogdanov <bogdanovr@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5324 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-03-07 04:02:39 +00:00
parent 8428129d93
commit 59399c2471

View File

@@ -2457,7 +2457,7 @@ void scst_pr_read_reservation(struct scst_cmd *cmd, uint8_t *buffer,
if (buffer_size < 8) {
TRACE_PR("buffer_size too small: %d. expected >= 8 "
"(buffer %p)", buffer_size, buffer);
goto skip;
goto out;
}
memset(b, 0, sizeof(b));
@@ -2491,10 +2491,10 @@ void scst_pr_read_reservation(struct scst_cmd *cmd, uint8_t *buffer,
size = 24;
}
memset(buffer, 0, buffer_size);
memcpy(buffer, b, min(size, buffer_size));
skip:
out:
size = min(size, buffer_size);
memcpy(buffer, b, size);
memset(buffer + size, 0, buffer_size - size);
scst_set_resp_data_len(cmd, size);
TRACE_EXIT();