From 20986f4c1b900c3d0e425e5ed93ccc90e40893cd Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 16 Jun 2015 23:49:18 +0000 Subject: [PATCH] scst_lib: Make a WRITE SAME debug statement more informative If a data length mismatch has been detected, report the LBA and the lengths that do not match. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6346 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 43a80154e..97cf59e8a 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -5491,7 +5491,11 @@ static int scst_ws_push_single_write(struct scst_write_same_priv *wsp, TRACE_ENTRY(); - EXTRACHECKS_BUG_ON(len != sg_data_length(wsp->ws_sg, wsp->ws_sg_cnt)); +#ifdef CONFIG_SCST_EXTRACHECKS + if (len != sg_data_length(wsp->ws_sg, wsp->ws_sg_cnt)) + WARN_ONCE(true, "lba %lld: %d <> %lld\n", lba, len, + sg_data_length(wsp->ws_sg, wsp->ws_sg_cnt)); +#endif if (unlikely(test_bit(SCST_CMD_ABORTED, &ws_cmd->cmd_flags)) || unlikely(ws_cmd->completed)) {