Date: Fri, 19 Oct 2012 19:27:34 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241749 - stable/9/sys/cam Message-ID: <201210191927.q9JJRYlD061171@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Oct 19 19:27:33 2012 New Revision: 241749 URL: http://svn.freebsd.org/changeset/base/241749 Log: MFC r241444: Increase device CCB queue array size by CAM_RL_VALUES - 1 (4) elements. It is required to store extra recovery requests in case of bus resets. On ATA/SATA this fixes assertion panics on HEAD with INVARIANTS enabled or possible memory corruptions otherwise if timeout/reset happens when device CCB queue is already full. Modified: stable/9/sys/cam/cam_queue.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_queue.c ============================================================================== --- stable/9/sys/cam/cam_queue.c Fri Oct 19 19:17:43 2012 (r241748) +++ stable/9/sys/cam/cam_queue.c Fri Oct 19 19:27:33 2012 (r241749) @@ -316,7 +316,8 @@ cam_ccbq_resize(struct cam_ccbq *ccbq, i * same size once the outstanding entries have been processed. */ if (space_left < 0 - || camq_resize(&ccbq->queue, new_size) == CAM_REQ_CMP) { + || camq_resize(&ccbq->queue, new_size + (CAM_RL_VALUES - 1)) == + CAM_REQ_CMP) { ccbq->devq_openings += delta; ccbq->dev_openings += delta; return (CAM_REQ_CMP); @@ -329,7 +330,7 @@ int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings) != 0) { + if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) { return (1); } ccbq->devq_openings = openings;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210191927.q9JJRYlD061171>