Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp492027imu; Fri, 7 Dec 2018 04:30:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/VtcRniWbmHQgNB3ah2MF81eAhyYfFay5OCKR8rLZ8FCP0aMPk8e1JhRJGCOf7GCNSxPnKc X-Received: by 2002:a62:9657:: with SMTP id c84mr2110020pfe.77.1544185800733; Fri, 07 Dec 2018 04:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544185800; cv=none; d=google.com; s=arc-20160816; b=w9v34ZmHqhteDx0s8WON+zvj2Q67bN3bPkXJqHcHh3cPne9UGOV4EMrDEZMgRJpMDF XAcsieGwE2VFRXMXPHZwo79aed/WlJp7sE33PzTrBMd9THFprM4GdJerH0m3QehnMOjq IxkpDiZaZKJHZtG7V/cjaN3Hq3mr6fAePPJGpwBS1mwAlTr8r8BOZaaiRQXcN4hPKtuP cvaRgOhxKD0bktlUcR5lQvouOXvfNp4eA4PUzkh42ivRG/ETzxQGmOLUTqhOf8yYsFpL uGiq4LUgmyvc54kkazctEIDx3tIa0u1kCNfBj8jEYhq3XU3CDZPhHYmw8GQ+4FktJyWD NmMw== 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:date:message-id:from :references:cc:to:subject; bh=w3LcRWVolAYvHwNU56RMonrwm8G8Y2uxBpBw8LD9zwE=; b=XfcJ4iY0PBDCiK7ClL/4ANnWQZtcn/1wF9+9Ozy2lMfbSQCFMTztF87O7+81rf3Jz9 rsHDO6pR80Brn+ppe8A1k2sM8V3/jh/qFWMV/UukxsX04ehV9VKMlUz9wEIptdVt3hG1 OP1weHMT0i1v+469wHDRZUuze/bFMk3lDUAAwDIXmS3eI5z9hfhysQbtCxJ2QRAuWfe2 uQesGq2/3f4ePT1MW05jygDnYPMivVzmWpki5e7eFNqaMb+s6sWvOr9HTk8dMCGnQvak l7SNzkaLRSL8u+7LOuh7VygOiWR1ckaHOR6JHT+dOi1IjU9TY86IjyPPF7xuwAmvktAj eHcg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si2911234pgg.44.2018.12.07.04.29.44; Fri, 07 Dec 2018 04:30:00 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726050AbeLGM2z (ORCPT + 99 others); Fri, 7 Dec 2018 07:28:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeLGM2y (ORCPT ); Fri, 7 Dec 2018 07:28:54 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 909DD30024A2; Fri, 7 Dec 2018 12:28:54 +0000 (UTC) Received: from alatyr.usersys.redhat.com (unknown [10.43.17.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D86966293B; Fri, 7 Dec 2018 12:28:53 +0000 (UTC) Subject: Re: [PATCH v2] kobject: add kernel/uevent_features sysfs file To: Greg KH Cc: linux-kernel@vger.kernel.org, msekleta@redhat.com References: <20181207114607.26981-1-prajnoha@redhat.com> <20181207120123.GB15336@kroah.com> From: Peter Rajnoha Message-ID: Date: Fri, 7 Dec 2018 13:28:52 +0100 MIME-Version: 1.0 In-Reply-To: <20181207120123.GB15336@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 07 Dec 2018 12:28:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/7/18 1:01 PM, Greg KH wrote: > On Fri, Dec 07, 2018 at 12:46:07PM +0100, Peter Rajnoha wrote: >> This patch adds /sys/kernel/uevent_features file which currently lists >> 'synthargs' string to denote that the kernel is able to recognize the >> extended synthetic uevent arguments. Userspace can easily check for >> the feature then. > > So this is just to try to have userspace detect what type of feature the > kernel has? Why can't you just go off of the other sysfs file itself? > You shouldn't need a "this is a feature list" for the kernel, otherwise > we would be on a huge slippery slope trying to document everything. > > Who is going to use this thing? And what else would go into it? > > Isn't there some other way you can detect this from userspace (like > writing to the file and it fails?) > Yes, it's for userspace to be sure that uevent interface has certain features available that it can use. For now, it's just that "synthetic uevent arguments" that is the extension of the original uevent interface. That applies to both input (writing to /sys/.../uevent file) and output (related extra variables that appear in generated uevents). The obvious user of this is going to be systemd/udev that will add extra variables to identify various synthetic uevents it produces (coming as result of the WATCH udev rule, coming from the udevadm trigger call and other specific uses where it needs to generate synthetic uevents). Other users I know of involve storage handling tools which need to generate these synthetic uevents whenever a change happens and it needs to synchronize with udevd processing (e.g. waiting on refresh to get reflected in udev database). I understand that there is an argument that we can just use kernel version check, but this is not acceptable for all unfortunately (see also https://github.com/systemd/systemd/pull/7294#issuecomment-343491015). The issue with checking the return code after writing to /sys/.../uevent is that it doesn't work with older kernel releases because there, it always returned success, no matter if the input string was correct or not or whether the arguments were recognized (unfortunately, this was like that from beginning, it seems). Even though, I've fixed this return code with df44b479 recently, but still, there are possible older releases out there... And still, there might be new variables introduced in the future that don't necessarily need to be direct result of writing to /sys/.../uevent file. -- Peter