Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp674080pxb; Tue, 19 Oct 2021 10:33:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDEMLJxImTZIbijdN5q7OQC/ts/1vQxdVYiyYxQU/FhBiwxZQNygEpUnY3xpqqddNSRdB0 X-Received: by 2002:a05:6402:84a:: with SMTP id b10mr55711180edz.121.1634664804313; Tue, 19 Oct 2021 10:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634664804; cv=none; d=google.com; s=arc-20160816; b=qIEQ2TokgnE9On/hBaF7dCUEUz87Wl2b+/H7JvE6aFZRyzLCJ8hp9H66wBHYkfYkCd EiAszX7xiyhKOv/3MZgrXaOljraQHatuKNh8Lj3sTNBXJtRN1E74Fg+LrzgmJMWRh3a5 Q26SGGol+GTUFiB1zT3j20EVorWRhSUUTujltdNTn0MI2cdlSNEM1kM1dgDvntx8xWKJ Krhn+Ze6EvfSJoWndPg7B5DFIoALM6vX1OQvF55yFCoYN0Nz4QKj/LRcV6Al9VaRjI3m jrFQ/YER6atTQieRkl45qBtXorw/Qz3RYhgopRx4dzlr2gtZsnLoAQJyRrsopTA1dauh JriQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jcVAvcHO1tvZOjidq2P8ZlLlDLauX+bUCVlzejfWCn8=; b=g8F10OUj18i+M9C09/dvcVLEzBSfIJlT5Y8P8rOxlkwKaSe4XRT3KkU6Nnj2QrwdAT 0rX+Am0H+jI2svy3jI6dE60I5KhvsV5BfH8FS4vYZR3WX88TFIsX95GkImVwtnU5UX1n /Q/KF1tXRtwIl030lL3efQtFQhO1RsYiLEVLhTatk7d837lqS5mgIsFn3uzfuPFGWry9 38/F9g0JB8o7+xKJhq4cgvK4T9PFydgsaykgGvoPoFuT4fUB/TUFe2gqvXajCoGDrfy7 ZsEzYxAqT6G5sW7DT1DA5BuOtqJ5djfUXGzfq+mJZUt7L4Fh6DkJ+RDX3BJoUB7WrIFq TvBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YWZi9VFv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si24952289edn.606.2021.10.19.10.32.58; Tue, 19 Oct 2021 10:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YWZi9VFv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234524AbhJSRav (ORCPT + 99 others); Tue, 19 Oct 2021 13:30:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:56440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbhJSRau (ORCPT ); Tue, 19 Oct 2021 13:30:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2BE4F61355; Tue, 19 Oct 2021 17:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634664517; bh=59LlQsuP3ZW+Cqkg0bmKDDTdZJ6xYatNGwXXx+Ql12c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YWZi9VFvsWHjYkDIPd8f49GxBVmj/S9NVGgH7d94tK3kKeCF+lF3syMiKzMmqfuyg JEHxrMIxVUmTbr2P3UxsxW/NFBzES4GLdSmR5jSm9QRoc0t7a8kiYYJnuP8TXiAFgt ifpV2BfQaooqVVlB4sG6JiSoyYkjtUSC8FI4Ss/k= Date: Tue, 19 Oct 2021 19:28:35 +0200 From: Greg KH To: Luis Chamberlain Cc: Ming Lei , Benjamin Herrenschmidt , Paul Mackerras , tj@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, jeyu@kernel.org, shuah@kernel.org, bvanassche@acm.org, dan.j.williams@intel.com, joe@perches.com, tglx@linutronix.de, keescook@chromium.org, rostedt@goodmis.org, linux-spdx@vger.kernel.org, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 11/12] zram: fix crashes with cpu hotplug multistate Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 09:30:05AM -0700, Luis Chamberlain wrote: > On Tue, Oct 19, 2021 at 06:25:18PM +0200, Greg KH wrote: > > On Tue, Oct 19, 2021 at 08:50:24AM -0700, Luis Chamberlain wrote: > > > So do you want to take the position: > > > > > > Hey driver authors: you cannot use any shared lock on module removal and > > > on sysfs ops? > > > > Yes, I would not recommend using such a lock at all. sysfs operations > > happen on a per-device basis, so you can lock the device structure. > > All devices are going to be removed on module removal and so cannot be locked. devices are not normally created by a driver, that is up to the bus controller logic. A module will just disconnect itself from the device, the device does not go away. But yes, there are exceptions, and if you are doing something odd like that, then you need to be aware of crazy things like this, so be careful. But for all normal drivers, they do not have to worry about this. thanks, greg k-h