From patchwork Thu Jun 18 09:43:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 6634741 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5345BC0020 for ; Thu, 18 Jun 2015 09:44:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95A9620811 for ; Thu, 18 Jun 2015 09:44:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C68D20771 for ; Thu, 18 Jun 2015 09:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754539AbbFRJn5 (ORCPT ); Thu, 18 Jun 2015 05:43:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:54751 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754213AbbFRJnr (ORCPT ); Thu, 18 Jun 2015 05:43:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id ED0A4ADDD; Thu, 18 Jun 2015 09:43:43 +0000 (UTC) From: Hannes Reinecke To: Nic Bellinger Cc: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, Christoph Hellwig , Ewan Milne , Hannes Reinecke Subject: [PATCH 6/8] target: Issue Power-On/Reset UA upon LUN instantiation Date: Thu, 18 Jun 2015 11:43:40 +0200 Message-Id: <1434620622-65391-7-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1434620622-65391-1-git-send-email-hare@suse.de> References: <1434620622-65391-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Whenever a LUN is being assigned we should be sending out an Power-On/Reset UA. Signed-off-by: Hannes Reinecke --- drivers/target/target_core_device.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 52676a0..88d6070 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -363,9 +363,11 @@ int core_enable_device_list_for_node( rcu_read_lock(); hlist_for_each_entry_rcu(tmp, &nacl->lun_entry_hlist, link) { if (tmp == new) - continue; - core_scsi3_ua_allocate(tmp, 0x3F, - ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED); + core_scsi3_ua_allocate(tmp, 0x29, + ASCQ_29H_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURED); + else + core_scsi3_ua_allocate(tmp, 0x3F, + ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED); } rcu_read_unlock(); @@ -385,9 +387,11 @@ int core_enable_device_list_for_node( rcu_read_lock(); hlist_for_each_entry_rcu(tmp, &nacl->lun_entry_hlist, link) { if (tmp == new) - continue; - core_scsi3_ua_allocate(tmp, 0x3F, - ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED); + core_scsi3_ua_allocate(tmp, 0x29, + ASCQ_29H_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURED); + else + core_scsi3_ua_allocate(tmp, 0x3F, + ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED); } rcu_read_unlock(); return 0;