Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp321256ybi; Tue, 18 Jun 2019 23:36:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHCnlDZBWdl/YL7FeDpfyFMgX5kIjp5IN8jAAWmOvjqqaOcai2wKpHF2ogOAHPVhhJk7Ma X-Received: by 2002:a17:902:b688:: with SMTP id c8mr6657370pls.123.1560926211200; Tue, 18 Jun 2019 23:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560926211; cv=none; d=google.com; s=arc-20160816; b=UQdARTavxXFPvWHhKwsNDmIK9k/2OsfSCeIIVv5UgdRenEfDFyglEHao1Eq3d6bwAW mhzswAZf9TE2Vwu0eWzdyBBwlkJE503YCBHuG0615+II5uSVbpbVOodjVXa7okJjvh90 AvFUe/BzKd/Xg/onp3Y4gjcM/2WuHmT16XQay1Rx3EMH1OoIbhDmuaPPfG8VpqZtpUMn ac5kFidf79YYsupp1s0jozqBBTyEo2qoAGAqLLTfyy/Swtcd9H88XHoQH/na2yosoxtC wRBn4TL+1QKK1pM7Rx/9h82SjdxCCQuB1ftQkDHB0ag385z8F5xtLzJtZgmRo6mj3p+J 5VsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=L51faQcgmnoa3dc7o+63uKZk0V9EcuoO/LQTle97PD0=; b=aZStf889oXl7YcAE2AW8NImV3a6k8ZPQtCMRt50KXzJiVK4yLZpiJ/MlVd72kqCas+ CRnyG76obOqwg2y5T0GC/pP9Zs2ktlQ9sDV2T+SqNjghSv9jp8ZzcIHqkm3CDu2r98N7 suGugcp/kFPMACyXi+gkIjLAYe+arXjFxtKnUF9r3EKmI9t+rfbi4aZaID3qks08Z2hm yJ12ieJYYjwkhvPhIvPrYD5gMV2FMXheWhklzKJCqyDHZT0IMxlnRV3jzzh6ZRD+ii5Y roeQsmP4zb/CyjfMiNvrfqiWC5Jfh+PSZhBK7UYRIpe8IF4tXFluMUYjoGT87ltt/csZ 0WGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si537932pjt.82.2019.06.18.23.36.35; Tue, 18 Jun 2019 23:36:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730990AbfFSGe7 (ORCPT + 99 others); Wed, 19 Jun 2019 02:34:59 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:50208 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfFSGe7 (ORCPT ); Wed, 19 Jun 2019 02:34:59 -0400 Received: from [10.160.4.48] (charybdis.suse.de [149.44.162.66]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Wed, 19 Jun 2019 08:34:57 +0200 Subject: Re: [PATCH] scsi: scsi_sysfs.c: Hide wwid sdev attr if VPD is not supported To: "Martin K. Petersen" , Marcos Paulo de Souza Cc: linux-kernel@vger.kernel.org, "James E.J. Bottomley" , linux-scsi@vger.kernel.org References: <20190612020828.8140-1-marcos.souza.org@gmail.com> From: Hannes Reinecke Message-ID: <850765d7-da85-3fc1-7bf4-f0edcb63f8d8@suse.com> Date: Wed, 19 Jun 2019 08:34:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/19/19 5:35 AM, Martin K. Petersen wrote: > > Marcos, > >> WWID composed from VPD data from device, specifically page 0x83. So, >> when a device does not have VPD support, for example USB storage >> devices where VPD is specifically disabled, a read into > device>/device/wwid file will always return ENXIO. To avoid this, >> change the scsi_sdev_attr_is_visible function to hide wwid sysfs file >> when the devices does not support VPD. > > Not a big fan of attribute files that come and go. > > Why not just return an empty string? Hannes? > Actually, the intention of the 'wwid' attribute was to have a common place where one could look up the global id. As such it actually serves a dual purpose, namely indicating that there _is_ a global ID _and_ that this kernel (version) has support for 'wwid' attribute. This is to resolve one big issue we have to udev nowadays, which is figuring out if a specific sysfs attribute is actually supported on this particular kernel. Dynamic attributes are 'nicer' on a conceptual level, but make the above test nearly impossible, as we now have _two_ possibilities why a specific attribute is not present. So making 'wwid' conditional would actually defeat its very purpose, and we should leave it blank if not supported. Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.com +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)