Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4014281imu; Mon, 12 Nov 2018 04:29:39 -0800 (PST) X-Google-Smtp-Source: AJdET5ee1fn21rUFDjpRZTJqCjEv6Icyd3hMrdz8zOEZ/kOyt9rYaRlgyNr+PigmRmVVlFy+C1c+ X-Received: by 2002:a63:d34a:: with SMTP id u10mr651449pgi.301.1542025779679; Mon, 12 Nov 2018 04:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542025779; cv=none; d=google.com; s=arc-20160816; b=yalmnmSyT8pW8Jv/mjXCs0jnv5Oly1QSZMgPZkRbFsCfGMxyPh/faILFiLsTqZ+vb5 VN30in8z74+/7N3g5mMb/7vrx57cK6NnKauk5dWXd+XCNQf3TMLhAh0qACj3knp5k/nz xpddWq0fyW120RgtUQQCayTBGSnnQmrB70+dN9eMR80DS4LvyYpyW5UHOI+bfrHVCnRm /t+TWUlAHvfdRpAXp1IxYLua7sJNilr86SscBCU1wO5Od5NpFCckUAV5z+831+ZFl8jP nKJBGNQPi353eOayztE/PrF73DNID0/dio+oh4MW3kQt5KyK+J46HH9m6M71gQ6UBR9r vjUA== 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=6PAOHh6vPaRbSEVNMUn2POc2jmqivxf5HhfSbXQZSV8=; b=zh7OYXeCcGpsluX9J8Tw234VqLX3lLfTWxhfBAVVxqW6VtFUSYwdxZ6KB7r65DiXSC N5qPPVhvSxGRBW8oMkhEn8zXnYU6RjpNIslkDxzv5aYC/92qHErB20nKvP+aSslST+CU rDPOsuwRin5xZQDcU83GzCsCP8KjTzbwL3oxrddetkJ5ynNWa82XFsA2n2qHEuZkH4oR M3E35LAUyNFmz6qlzDOMWvpJVf0zFoOtatidTXRUdn05PSXQr2nhoJ3Yw5cuTzV4ZVkV I8Qqd7Jpw59/Mo5wzp8+AF+ZwWBNorIIIEQiiLCBS/p/yqSG67TxZz/rQP9ylQW+gfRN F82g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XLBt3LBK; 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 l194si17002844pga.594.2018.11.12.04.29.23; Mon, 12 Nov 2018 04:29:39 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XLBt3LBK; 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 S1729628AbeKLWVp (ORCPT + 99 others); Mon, 12 Nov 2018 17:21:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:38100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729296AbeKLWVp (ORCPT ); Mon, 12 Nov 2018 17:21:45 -0500 Received: from localhost (unknown [206.108.79.134]) (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 D742D2080D; Mon, 12 Nov 2018 12:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542025720; bh=kucl4q/8e40D4A8W9UZj4JJzE5Vks07LAHce70ttib4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XLBt3LBKUEQgXJ+NeiIwjfArL3fwyD/JmQwATw6Wle9KHp5KLJHS8y+LID0KzvJY2 ZPSxJfJx7NcdIilkSznbKakrgDLf26ZXZHPHsaG8jKWDCTunuO3hU6ZoxUgKZIXE7J oHhG7PheQFHHqHPS9CftGwCZBaBVePndi1vsGUyM= Date: Mon, 12 Nov 2018 04:28:40 -0800 From: Greg Kroah-Hartman To: Paolo Valente Cc: Jens Axboe , Tejun Heo , Li Zefan , Angelo Ruocco , Dennis Zhou , Josef Bacik , Liu Bo , Bart Van Assche , Johannes Weiner , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, Jonathan Corbet Subject: Re: [PATCH 01/12] kernfs: add function to find kernfs_node without increasing ref counter Message-ID: <20181112122840.GA1429@kroah.com> References: <20181112095632.69114-1-paolo.valente@linaro.org> <20181112095632.69114-2-paolo.valente@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181112095632.69114-2-paolo.valente@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 12, 2018 at 10:56:21AM +0100, Paolo Valente wrote: > From: Angelo Ruocco > > The kernfs pseudo file system doesn't export any function to only find > a node by name, without also getting a reference on it. > But in some cases it is useful to just locate a kernfs node, while > using it or not depends on some other condition. > > This commit adds a function to just look for a node, without getting > a reference on it. Eeek, that sounds really bad. So you save off a pointer to something, and have no idea if that pointer now really is valid or not? It can instantly disappear right afterwards. This feels wrong, what is the problem of having a properly reference counted object passed back to you that you have to create a dangerous function like this? greg k-h