Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752585AbdI2XA0 (ORCPT ); Fri, 29 Sep 2017 19:00:26 -0400 Received: from mga09.intel.com ([134.134.136.24]:21286 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448AbdI2XAZ (ORCPT ); Fri, 29 Sep 2017 19:00:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,454,1500966000"; d="scan'208";a="905254551" Date: Fri, 29 Sep 2017 16:59:49 -0600 From: Keith Busch To: Martin Wilck Cc: Jens Axboe , Christoph Hellwig , Johannes Thumshirn , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Hannes Reinecke , linux-nvme@lists.infradead.org, Martin Wilck Subject: Re: [PATCH 1/2] block: genhd: add device_add_disk_with_groups Message-ID: <20170929225949.GP8463@localhost.localdomain> References: <20170928193637.24707-1-mwilck@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170928193637.24707-1-mwilck@suse.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 855 Lines: 20 On Thu, Sep 28, 2017 at 09:36:36PM +0200, Martin Wilck wrote: > In the NVME subsystem, we're seeing a race condition with udev where > device_add_disk() is called (which triggers an "add" uevent), and a > sysfs attribute group is added to the disk device afterwards. > If udev rules access these attributes before they are created, > udev processing of the device is incomplete, in particular, device > WWIDs may not be determined correctly. > > To fix this, this patch introduces a new function > device_add_disk_with_groups(), which takes a list of attribute groups > and adds them to the device before sending out uevents. > > Signed-off-by: Martin Wilck Is NVMe the only one having this problem? Was putting our attributes in the disk's kobj a bad choice? Any, looks fine to me. Reviewed-by: Keith Busch