From owner-svn-src-all@freebsd.org Mon Dec 7 13:10:38 2015 Return-Path: Delivered-To: svn-src-all@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 CB18999ABB2; Mon, 7 Dec 2015 13:10:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 66728132B; Mon, 7 Dec 2015 13:10:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wmec201 with SMTP id c201so150041992wme.1; Mon, 07 Dec 2015 05:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=aF4ROdj7UudIysdLbbmufcXnboylhkmR8/zDbSGb+Vk=; b=qxvsf7jvx9p0CVeDla1kmvcCVNkDJuJbjt/C+si9edX9yv/Lvghw2o2y2NZZKpAgcK Ezt9jx94KCaC4xaBIYbIXYHxSTMgFANkmaq8pggC/l9Eyt0dEYjECsQF5cZHIm1qDMFi 0SCgNmZ7fPFgphkRkCzhCyW00FkoGuDXmYDbz50RThjn8vqeo5GkUv3Af9iGVox2rifp /cGTL3n4fkhsPE+OY4FhEiCFb56xck0kvAsa2JI+4WtCIWJ0iAdqtQpfJJgXM8aCJ8UR vTHeVZEV+YYMEt9a7Gp2R2UavCwvmMW1baa+xil7zGCWe7nIvuu2iKNqHu77rTRWlLxC gcow== X-Received: by 10.194.222.135 with SMTP id qm7mr33101936wjc.106.1449493836942; Mon, 07 Dec 2015 05:10:36 -0800 (PST) Received: from brick.home (acyr204.neoplus.adsl.tpnet.pl. [83.11.201.204]) by smtp.gmail.com with ESMTPSA id u205sm16490788wmb.12.2015.12.07.05.10.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 05:10:35 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 7 Dec 2015 14:10:32 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291911 - head/sys/dev/iscsi Message-ID: <20151207131032.GA12870@brick.home> Mail-Followup-To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <20151207112235.GA12517@brick.home> <56656EA9.6050002@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56656EA9.6050002@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 07 Dec 2015 13:10:39 -0000 On 1207T1134, Steven Hartland wrote: > > > 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. Well, the difference is pretty crucial here - previously, the purpose of iscsi_shutdown() was to disconnect the sessions during shutdown. Now it doesn't do that at all - established connections are kept intact, it just disables reconnections. And for this to work, it needs to happen as soon as possible during shutdown. > Currently shutdown is run too early and actually doesn't actually > terminate any sessions. What does "currently" mean in this context? > 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. I don't think that would work. The reason that the sessions don't terminate (in 11-CURRENT) is that they are not supposed to - unmounting filesystems will write data to LUNs, and we don't want to break that. The only reason iscsi_shutdown() exists is to prevent hang on shutdown when there are sessions that require reconnection and there is no way for it to succeed, because of iscsid is not running.