Date: Thu, 9 Oct 2014 05:28:12 +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-10@freebsd.org Subject: svn commit: r272798 - stable/10/sys/cam/ctl Message-ID: <201410090528.s995SC7n052993@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Oct 9 05:28:11 2014 New Revision: 272798 URL: https://svnweb.freebsd.org/changeset/base/272798 Log: MFC r272650: Set CAM_SIM_QUEUED flag before calling ctl_queue() to avoid race. PR: 194128 Submitted by: Scott M. Ferris <smferris@gmail.com> Sponsored by: EMC/Isilon Storage Division Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Oct 9 05:17:47 2014 (r272797) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Oct 9 05:28:11 2014 (r272798) @@ -609,14 +609,16 @@ cfcs_action(struct cam_sim *sim, union c bcopy(csio->cdb_io.cdb_bytes, io->scsiio.cdb, io->scsiio.cdb_len); + ccb->ccb_h.status |= CAM_SIM_QUEUED; err = ctl_queue(io); if (err != CTL_RETVAL_COMPLETE) { printf("%s: func %d: error %d returned by " "ctl_queue()!\n", __func__, ccb->ccb_h.func_code, err); ctl_free_io(io); - } else { - ccb->ccb_h.status |= CAM_SIM_QUEUED; + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + return; } break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410090528.s995SC7n052993>