From owner-svn-src-head@freebsd.org Mon Dec 7 11:34:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BACA9B9CB9 for ; Mon, 7 Dec 2015 11:34:00 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD2E11796 for ; Mon, 7 Dec 2015 11:33:59 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmww144 with SMTP id w144so146091482wmw.0 for ; Mon, 07 Dec 2015 03:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=kCLIxtXDuPhQn28amWHqFLru9aeTO7otrYbLKHDRswU=; b=erkX61bw/0onOf2QBOdUHbjnYihOhrw37UDR1Q6+cmdGIp8A4dJlP1z+VC+b84enyb s46BZjzzD40xngBEnitc4Ip0SPysNVjPa0q1/zYcJ95DVUno4A44AmM+/PopcG0b59yg cdNI9mAfZ0jI+s3m4J2NIaLYTSYprJM/cHXTxqA5VvdPMBa+oUpTOae0LXHqJngy0Fhq Eq4AuCLy35LSY2lwtfQCdkVmxWtK6G1bXovSORWjVoxvnhRbdRUIcKsZ6mFWGVG0HHEW LC1DYu8zeLsJl+o9x3EJw9JJVAtLXqoL84hY+XX3jbIKg6ua0FeaHBhXSHwTx7wimseb 0nag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=kCLIxtXDuPhQn28amWHqFLru9aeTO7otrYbLKHDRswU=; b=CTK16NK+Pqo+jYSy/gHOyGS6LNvcC9uTang3YxOp2xEHzs1XwL8f9BYEjpS33OvuBi drJr1dBHTblkcihU2NNC8Uo2VuOrHqUK9sb6AVKZmktAaR2ONZk65V/3Vk0Uhlkm+x8J BlXSfC0qM9FQYYVde0WHfKx2wC1ObD+O5/99P4JDSX96ZsZb5+HCaKPBvlY70jsMoOzW cWNOV5p9Ia89arZyxAqMnM5BpoxGDUpi8bCfifuBXvO6Nzz5rtikf5BvAuyZQukxEaVP 5FhmauQMG1eTrItk6SCi7xUt8khTEGa4cG8RONONxhKBLpv4HAt2W/vuV77maHRHSZjP vsIA== X-Gm-Message-State: ALoCoQlTI2/eszbqsgaiNqT9m11K5isO1El0WgIyRtR90wUBGGXqsau9lSz1ko/C1ZYPTanibMq6 X-Received: by 10.194.118.36 with SMTP id kj4mr8082761wjb.88.1449488038124; Mon, 07 Dec 2015 03:33:58 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id uw6sm24835440wjc.42.2015.12.07.03.33.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 03:33:57 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r291911 - head/sys/dev/iscsi To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <20151207112235.GA12517@brick.home> Message-ID: <56656EA9.6050002@freebsd.org> Date: Mon, 7 Dec 2015 11:34:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151207112235.GA12517@brick.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:34:00 -0000 On 07/12/2015 11:22, Edward Tomasz NapieraƂa wrote: > On 1207T0256, Steven Hartland wrote: >> Author: smh >> Date: Mon Dec 7 02:56:08 2015 >> New Revision: 291911 >> URL: https://svnweb.freebsd.org/changeset/base/291911 >> >> Log: >> Fix panic on shutdown due to iscsi event priority >> >> iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to >> run before other high priority handlers such as filesystems e.g. ZFS. >> >> This meant the iscsi sessions where removed before the ZFS geom consumer >> was closed, resulting in a panic from g_access calls on debug kernels >> due to negative acr. >> >> Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 >> which allows it to run before dashutdown etc but after filesystems. > I think this might be backwards. Have you tested the following scenario: > > 1. Establish the iSCSI session > 2. Mount the LUN somewhere > 3. Make the target not reachable (eg ifconfig down), so that the > initiator tries to reconnect > 4. Try to shutdown? > > Basically, the point of this code is to disable reconnects when there > won't be any iscsid(8) instance to handle them. The iscsi_shutdown() > isn't supposed to remove working iSCSI sessions. I didn't notice your change in head / stable/10 compared to releng, so I'm testing further updates now. Currently shutdown is run too early and actually doesn't actually terminate any sessions. My current theory is the issue you tried to fix in 286226 is actually caused by the iscsi_maintenance_thread preferring reconnect over terminate, so what you where seeing was the terminate never action for reconnecting sessions. I'm currently trying to validate that theory now. If I'm right then the fix should be to revert the majority of 286226 and move the processing of terminate above reconnect in iscsi_maintenance_thread. Regards Steve