Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp242506pxf; Thu, 8 Apr 2021 01:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX2U0pOjLv7kkBx9+YC1c/kDgp02/FmznrynnQAj9xp72z9D1zSewNDb+dzGWWypQ/pIDo X-Received: by 2002:a17:90a:5889:: with SMTP id j9mr7608404pji.69.1617872212058; Thu, 08 Apr 2021 01:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617872212; cv=none; d=google.com; s=arc-20160816; b=tgdfviZhmjRfippdIdjI6vkzjwPeNoinSSLFJfAPgvZgcPYy2EGP8+SkOYLTrF0mvl BvkPnJK8/KOfLzloA2Rw4BFA7OKydd4vtGdU2iFOMQOjky8zFdHGtQ8Uyx1TIBLMcBBq /p6HM/yqumcqX2XpwRkJKmewMswFsf61sN+7hoNQklIwvNBvzFHssjLboy98u0WSxZ1t lkXhmb5FCJoJVgVnd8o7g9sCuAyo/SbbIoGChQLgf4jZgf9KVihUK3Z924ZFDIU7c67R fOI42xiQ8p9JoCHEzPy++3m2f7AHppwS3OX8uAEqzJ3KByjvpG2GP4ejyPsKzXy5gtqE 2fWw== 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=1kCTLe5lPNA+yvzcy7oOlbUAl22hrj/FccF8z95xAYA=; b=WEM4V38os+D+SDrITLNUC27j1b++sK94qwXJa++Cs1ye8YJ5FkYuy5tTe0qQ6AUvnV 5ksmHc8YeThdQtEERifV3gnEpqcqfAMJHBPZDaznyc8Lkg9R4bspG9A3U1PlRSnRgx8+ h9+U3gOK5lOYt3SHRxSRlhJTe8VKR4yc5lUIoHeHlpLpgR/QabZnORZ6CdWYujkcTEzY yA7P+2mdclcA5j4RZVHaIqPhb4xs5un01RZzF55rXnIxTLX+/WGiCh1wOLrd2AoH1Bl/ fldhdn4NxcLBtjtTeiN2XVR7rDK3X6OvQapm3BEgcRwLR/QkkuF2+VRrQq+C0iyECXi4 0gFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="EWoY/Xxw"; 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 q81si27825233pfc.25.2021.04.08.01.56.40; Thu, 08 Apr 2021 01:56:52 -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="EWoY/Xxw"; 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 S229689AbhDHI4J (ORCPT + 99 others); Thu, 8 Apr 2021 04:56:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:49520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbhDHI4I (ORCPT ); Thu, 8 Apr 2021 04:56:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E798610CF; Thu, 8 Apr 2021 08:55:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617872156; bh=/gCV8q264AbYItnyZblsnp9HILxQ2LYQ2c+GJrkxghA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EWoY/XxwMP+/96DP+j6tHTYDnIJE+TR2kRqp689xLMoUvkE6itIthdYry6s40o+8m GQBKK8NtxNcTs78VQpv4qZnDZXV0b4iGUKprrEn6+cGmf++pjdH8zJLaoDw1CIPwDJ FBF4mI6MVTfNnvdPZ9jkDAKDyoQ5F0EJhKHgYPAI= Date: Thu, 8 Apr 2021 10:55:53 +0200 From: Greg KH To: Jiri Kosina Cc: Thomas Gleixner , Luis Chamberlain , Minchan Kim , keescook@chromium.org, dhowells@redhat.com, hch@infradead.org, mbenes@suse.com, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate Message-ID: References: <20210322204156.GM4332@42.do-not-panic.com> <20210401235925.GR4332@42.do-not-panic.com> <87blap4kum.ffs@nanos.tec.linutronix.de> 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 Thu, Apr 08, 2021 at 10:35:17AM +0200, Jiri Kosina wrote: > On Thu, 8 Apr 2021, Greg KH wrote: > > > > If there is a driver/subsystem code that can't handle the reverse > > > operation to modprobe, it clearly can't handle error handling during > > > modprobe (which, one would hope, is supported), and should be fixed. > > > > Huh? No, that's not the issue here, it's the issue of different > > userspace code paths into the module at the same time that it is trying > > to be unloaded. That has nothing to do with loading the module the > > first time as userspace is not touching those apis yet. > > So do you claim that once the first (out of possibly many) > userspace-visible sysfs entry has been created during module insertion and > made available to userspace, there is never going to be rollback happening > that'd be removing that first sysfs entry again? {sigh} I'm not trying to argue that, no. What I am arguing is that the complexity that the original patch was not worth the low probablity of this actually being an issue hit in real-life operations. That's all, messing around with sysfs entries and module reference counts is tricky and complex and a total mess. We have a separation between normal sysfs files and devices being removed that should handle the normal operations but there are still some crazy corner cases, of which this seems to be one. Module removal is not a "normal" operation that can be triggered by a system automatically without a user asking for it. As someone reminded me on IRC, we used to do this "automatically" for many problematic drivers years ago for suspend/resume, that should all now be long fixed up. So to add crazy complexity to the kernel, for an operation that can only be triggered manually by a root user, is not worth it in my opinion, as the maintainer of that code the complexity was asked to be made to. My throw-away comment of "module unloading is not supported" was an attempt to summarize all of the above into one single sentence that seems to have struck a nerve with a lot of people, and I appologize for that :( thanks, greg k-h