Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp266346ybe; Tue, 3 Sep 2019 22:26:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwt41jjv+NO8IVHFqFzqP4gA9hEGCYe4AfS3kqvTIYHtNZxJEMSXYzSiiserz62K9G2wkrd X-Received: by 2002:a62:e50f:: with SMTP id n15mr41150221pff.208.1567574807930; Tue, 03 Sep 2019 22:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567574807; cv=none; d=google.com; s=arc-20160816; b=DY6fT5nXFBTQ0BJqtgXubYdjAfPGiY9B5eOsZwbtGv1WCZSt7B8EUt85SUBVuseB3+ j7cgC4Q1OxdcqgDPTv9B0eJmuAJKSMFrYA5CQWRUnZoY0xH/uj0U11WgEEV9A4YQWFou 9DsucEW2bhN3lXrWAwk9yiJ9T/oLizi9akdLLR4WDKkcNKYQzI/vTg93EwrpsdxLMLRD regl3cU/Xn6uf56H3sTaDDligupzACYVxPZrdig0ntCmXx5I8aV2MNRHYFp7szZX7Y5h eBQhLPVEBF2c/crPaaEv3KLMc+7biZO1uLy5S5blH3N6VFyqXsn9gJjNcIXuePYHTuOF +mog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8341yCJFIdjbCQDNTtShN5JrgItg3NnuNG9yAJd94v4=; b=0H6IOja72/mBo8IF2zMz/MXmK3ZzNWBlkRmDGAwkPeUlDgR67Ql68VEfdam/ldFMht vtYmyPO8XTvjrbCmW7VxMWIMxLIlA+JQF7a4hG2rJuVY1OXc62uHKwrVnJtc9rEuZigf Xsyn0g6YzIwwNCHSa6kvPVCOT1Ft1YvIVlegPVenNL4kXvehatDKjIpmwLwRm6sYO6TN rs/+MxbzuZu6RJeJ7JaGaHQlB7IBNQHl2zNR2hTMoV9EzcEjKcSaGIvLkLUOuO8tjWo7 5mj1ebY1i1czqNVn6iYqe4n9gqxq7rot8tiTxr6E+rFj/YkFyGU8dN1S8CscnZzUMRon 6Bmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NHS6x1AV; 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 s2si1462717pji.79.2019.09.03.22.26.31; Tue, 03 Sep 2019 22:26:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NHS6x1AV; 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 S1726045AbfIDFZl (ORCPT + 99 others); Wed, 4 Sep 2019 01:25:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfIDFZl (ORCPT ); Wed, 4 Sep 2019 01:25:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04C802339D; Wed, 4 Sep 2019 05:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567574740; bh=CXNu9IN1Uq+0JFc0kjRWO1y9r0+ATS28FSmG0b0t2mk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NHS6x1AV4wFH2nBQ/fs186BvlLSw8U4EgEYYBHRQle4S+DEKxvQ8C/hiKfdTTkgXM WpXCxyb72sNYUSsGaZQLxZxjt9YMfseuWBDqFeZuGg+of3G70kT8FpQ3meUUbNzkV/ kTNyNEDxSMKSUaitSylkwH88KhVhUza8BemG3+oA= Date: Wed, 4 Sep 2019 07:25:38 +0200 From: Greg Kroah-Hartman To: Sagi Grimberg Cc: Christoph Hellwig , linux-nvme@lists.infradead.org, Keith Busch , James Smart , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace Message-ID: <20190904052538.GB17236@kroah.com> References: <20190822002328.GP9511@lst.de> <205d06ab-fedc-739d-323f-b358aff2cbfe@grimberg.me> <20190826065639.GA11036@lst.de> <20190826075916.GA30396@kroah.com> <20190830062036.GA15257@kroah.com> <73e3d2ca-33e0-3133-9dfb-62b07e5b09c4@grimberg.me> <20190902193341.GA28723@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 03, 2019 at 06:35:30PM -0700, Sagi Grimberg wrote: > > > > Still don't understand how this is ok... > > > > > > I have /dev/nvme0 represents a network endpoint that I would discover > > > from, it is raising me an event to do a discovery operation (namely to > > > issue an ioctl to it) so my udev code calls a systemd script. > > > > > > By the time I actually get to do that, /dev/nvme0 represents now a new > > > network endpoint (where the event is no longer relevant to). I would > > > rather the discovery to explicitly fail than to give me something > > > different, so we pass some arguments that we verify in the operation. > > > > > > Its a stretch case, but it was raised by people as a potential issue. > > > > Ok, and how do you handle this same thing for something like /dev/sda ? > > (hint, it isn't new, and is something we solved over a decade ago) > > > > If you worry about stuff like this, use a persistant device naming > > scheme and have your device node be pointed to by a symlink. Create > > that symlink by using the information in the initial 'ADD' uevent. > > > > That way, when userspace opens the device node, it "knows" exactly which > > one it opens. It sounds like you have a bunch of metadata to describe > > these uniquely, so pass that in the ADD event, not in some other crazy > > non-standard manner. > > We could send these variables when adding the device and then validating > them using a rich-text-explanatory symlink. Seems slightly backwards to > me, but that would work too. That's the way the driver model is expected to work, instead of having to do crazy device-specific stuff. > We create the char device using device_add (in nvme_init_subsystem), > I didn't find any way to append env variables to that ADD uevent. You do that in your uevent or dev_uevent callback like all other subsystems. Nothing "new" to do here, again, it's been working fine for everyone else for well over a decade now :) thanks, greg k-h