Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp106896ybe; Tue, 3 Sep 2019 18:37:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqygoorh1tZPhR6QPoA+rHcq0R/AskVgvBcVMYDuhyTax2vP5knjkiNePFUWB3v1nYXUZqXP X-Received: by 2002:a62:3083:: with SMTP id w125mr24281309pfw.102.1567561057836; Tue, 03 Sep 2019 18:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567561057; cv=none; d=google.com; s=arc-20160816; b=b/myDKObcc6MMgndBeh21/w60knaO/zCTXTm0RXpdBRufsmlpQXXvlgEPOML2uTyU7 yGdxAC30NOB+zj07nH++vNq52wLg1HMJe1vtCO4NanhAMBXeDnEU7sJ88s8Vq3cnWV3o Hnn19EmQv5HrH+AP6v46b+h7ESTDvYYOINtHVA5I9E46B0dz36lSByqkirmZg3zkgW0H ZCNZK/JsEZMukZdcGYr4eGiPQ9I5LZC3L2ahz74c2BbAjb8n/XxDpZpzwcclI+c8Apkc lw63DVSr6VEkahfP3lY/rPNjoEOtAUtKyisWOWVJrLZwJ1SGKEkIMSfN+QT8By6ip+Z/ pgSQ== 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=cVriKr46na9K66+qbHPCbYZK287/xFQJ6lf/grUOyVA=; b=b/isLkv7VJXH0f4fxVocCIvpXulNxqcJxjHcr+NhtHsR1CAp/jJOK1z/J7VypmJcNB Zx+d98Lp9V/E/oxOyGUo8Opd20XJmlTxN8S+6m39xZyrL+eMi3N/lqX//asXPAQIimSj ClKGXbNRsSpWn0gK/x1AHpvcjX2DboTq75cRKrW2ZteAXDospbTucAV4vXMIpc7NsEKz SQtE69XoIClH+vTyE3H5YU4UiwsexJpZBNZrl+AL/avVqBGlYSMJej9nV9zEtZMSpO8R 57uKZQFIF4jkw8vG/4NWptFoxpl2RLnPCogqkjtIurqVaRI8mkNTiON3koYikNHDuAJw o03w== 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 u29si15529055pgm.325.2019.09.03.18.37.08; Tue, 03 Sep 2019 18:37:37 -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 S1727536AbfIDBfh (ORCPT + 99 others); Tue, 3 Sep 2019 21:35:37 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54446 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfIDBfg (ORCPT ); Tue, 3 Sep 2019 21:35:36 -0400 Received: by mail-wm1-f65.google.com with SMTP id k2so1397551wmj.4 for ; Tue, 03 Sep 2019 18:35:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cVriKr46na9K66+qbHPCbYZK287/xFQJ6lf/grUOyVA=; b=dwLJAZqD8o78uabzPeAtz+z+KWEpDK3GKkmqMj5lf0xJkxkN+LSFmYv+bDGi2Phn1d iSDZcWT0uHMcplEjpvnpjV0JhE5w0xeE+oVWDRBXWzlz4Z0pp1+30GtPRLFTH0EG8xTE 84NrfXTomp3mqyrNNNa5mcTbIECLmr5y8PGw+UXOScJGycdNBbckdUZKcFr5471ggeht HDurK12A+IQPhr59j5WBqBkHoPcjXjTNVAntuBq0hhTs0RcSyJgGRp/Ns44CkJf/gFWV NKmr3jSsRKrxvb8/1hRq60c5HxVGb1QaBymjZBA+uLGH1Hdfjivwshk1P6PoQnNg/EVH HPAg== X-Gm-Message-State: APjAAAXSZnu4AT+omrHA35tlFLhQf7mqSC6qvwrSb76Id12xqJKJbIjB zHVxsH8S+ge9gV6toVv0P7a1dcd7 X-Received: by 2002:a1c:9ecb:: with SMTP id h194mr2065048wme.35.1567560934037; Tue, 03 Sep 2019 18:35:34 -0700 (PDT) Received: from ?IPv6:2600:1700:65a0:78e0:514:7862:1503:8e4d? ([2600:1700:65a0:78e0:514:7862:1503:8e4d]) by smtp.gmail.com with ESMTPSA id a16sm935287wmg.5.2019.09.03.18.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Sep 2019 18:35:33 -0700 (PDT) Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace To: Greg Kroah-Hartman Cc: Christoph Hellwig , linux-nvme@lists.infradead.org, Keith Busch , James Smart , linux-kernel@vger.kernel.org References: <20190712180211.26333-1-sagi@grimberg.me> <20190712180211.26333-4-sagi@grimberg.me> <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> From: Sagi Grimberg Message-ID: Date: Tue, 3 Sep 2019 18:35:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190902193341.GA28723@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> 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. 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. Did you mean that we should add another flavor of device_add that accepts char *envp_ext[]? What exactly is the "standard manner" to pass these variables to the chardev KOBJ_ADD uevent? All other examples I could find use KOBJ_CHANGE to pass private stuff..