From owner-svn-src-all@FreeBSD.ORG Tue Jul 15 17:17:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84702291; Tue, 15 Jul 2014 17:17:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58B5A2DF6; Tue, 15 Jul 2014 17:17:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FHHrxH090819; Tue, 15 Jul 2014 17:17:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHHrqn090818; Tue, 15 Jul 2014 17:17:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151717.s6FHHrqn090818@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268696 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:17:53 -0000 Author: mav Date: Tue Jul 15 17:17:52 2014 New Revision: 268696 URL: http://svnweb.freebsd.org/changeset/base/268696 Log: MFC r268387: Fix task management functions status: task not found is not an error, while not implemented function is. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:16:58 2014 (r268695) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:17:52 2014 (r268696) @@ -11946,7 +11946,7 @@ ctl_abort_task(union ctl_io *io) lun = ctl_softc->ctl_luns[targ_lun]; else { mtx_unlock(&ctl_softc->ctl_lock); - goto bailout; + return (1); } #if 0 @@ -12049,8 +12049,6 @@ ctl_abort_task(union ctl_io *io) } mtx_unlock(&lun->lun_lock); -bailout: - if (found == 0) { /* * This isn't really an error. It's entirely possible for @@ -12066,23 +12064,19 @@ bailout: io->io_hdr.nexus.targ_lun, io->taskio.tag_num, io->taskio.tag_type); #endif - return (1); - } else - return (0); + } + return (0); } static void ctl_run_task(union ctl_io *io) { - struct ctl_softc *ctl_softc; - int retval; + struct ctl_softc *ctl_softc = control_softc; + int retval = 1; const char *task_desc; CTL_DEBUG_PRINT(("ctl_run_task\n")); - ctl_softc = control_softc; - retval = 0; - KASSERT(io->io_hdr.io_type == CTL_IO_TASK, ("ctl_run_task: Unextected io_type %d\n", io->io_hdr.io_type)); @@ -12131,7 +12125,6 @@ ctl_run_task(union ctl_io *io) case CTL_TASK_LUN_RESET: { struct ctl_lun *lun; uint32_t targ_lun; - int retval; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&ctl_softc->ctl_lock); @@ -12188,12 +12181,6 @@ ctl_run_task(union ctl_io *io) io->io_hdr.status = CTL_SUCCESS; else io->io_hdr.status = CTL_ERROR; - - /* - * This will queue this I/O to the done queue, but the - * work thread won't be able to process it until we - * return and the lock is released. - */ ctl_done(io); }