Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp555740pxb; Thu, 21 Jan 2021 13:49:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAtAe6/x67yJA/9yKW9Kkt1mGIDxVGBPkbfkDwOHvYTbPGRgB1Wh+rUkJeePiS7W8u8J7r X-Received: by 2002:a17:906:796:: with SMTP id l22mr986435ejc.247.1611265779085; Thu, 21 Jan 2021 13:49:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611265779; cv=none; d=google.com; s=arc-20160816; b=q/YeCxXs/2ek52BlimeQr8fUW7Hc1pXgAx7/uhQdew1pc6zU8CKh5x1tPeHUSIcgFF y0d4ctgbIv69NHWLVeeim+s3IQb+/KQn5eRJzdk8Qd943icj215gY9IMiMT2k9gFjhD1 e1vlSWVKKYqgZSkOIGumbZpSDZYRF8rw2IvM5YbMZGiTI8y9yi2AXiO2cWhbkTWgfR0M 6KMxUK4QytiDI0RoaY5tMJ14ArK+YIEzi3+KzePEfHIgt8nfkrGrxWGVu05IzCIloeas xkzfE92PeCdKNoQW1sbr+v0zQFJ6szfxdTZa9SPeA2I1nRBlra+xdWwfV6w1akpOlrn6 C7pw== 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=+rDl9+7fXwTudocqpSNQ/uswuuzlXykto241XVMPhJI=; b=pZzsSz9uRTjAAaGTXO2Ad47qPIhBf8MQ/78uVTgXmw5AgpWRuh/vJvqIcH4s0CBFIM IFeYZ6fBmvKkP2G/97Bk2eCXuJxBooAmPN4IiQHQi49lO0wh+buBIN4j9IQovOqDkBob VHKn5FRxpScFsXlux9XjTw00UUDLixQxSt21vWdRjGoy9glLx8Q27BnNyfwnf92NseYk VgTHN1M7XCOTK+wASniJCJWHQYyqXgEajaePCWlNjlpWBzMxB6+7NkTHJlhU0Yvsi7tq l1F55bV+yqvpYbpl+Tz2zrIBm4mNj0P/221XOdviQPHI76Gw95hBJV8hfL8dqCKvboRm u6gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="LM/1sC3e"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si2362862ejq.244.2021.01.21.13.49.13; Thu, 21 Jan 2021 13:49:39 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b="LM/1sC3e"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727323AbhAUVr1 (ORCPT + 99 others); Thu, 21 Jan 2021 16:47:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60475 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbhAUVrP (ORCPT ); Thu, 21 Jan 2021 16:47:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611265544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+rDl9+7fXwTudocqpSNQ/uswuuzlXykto241XVMPhJI=; b=LM/1sC3e+lKUb5z0jmTjiB956yUGt7W0OJILRK5D1BWKiNgnwPFePblUGEUBDYNnhq6fx/ TNDEUbMCm2erQ9eJR8+K0X+QksQIt02dIQml9D22UnhyW86se2DDWWj13+ghtvwElDaTNC Uy6EjLcrLBkYrbmPbeJS8oExzmsUpow= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-517-OKLBo_BNP5yCUTW080-5Wg-1; Thu, 21 Jan 2021 16:45:42 -0500 X-MC-Unique: OKLBo_BNP5yCUTW080-5Wg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E5AC802B40; Thu, 21 Jan 2021 21:45:39 +0000 (UTC) Received: from treble (ovpn-116-102.rdu2.redhat.com [10.10.116.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EF795F9B5; Thu, 21 Jan 2021 21:45:31 +0000 (UTC) Date: Thu, 21 Jan 2021 15:45:29 -0600 From: Josh Poimboeuf To: Christoph Hellwig Cc: Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jessica Yu , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 04/13] livepatch: move klp_find_object_module to module.c Message-ID: <20210121214529.il2ac3vk6oqogjpr@treble> References: <20210121074959.313333-1-hch@lst.de> <20210121074959.313333-5-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210121074959.313333-5-hch@lst.de> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 08:49:50AM +0100, Christoph Hellwig wrote: > @@ -820,14 +796,25 @@ static int klp_init_object(struct klp_patch *patch, struct klp_object *obj) > const char *name; > > obj->patched = false; > - obj->mod = NULL; Why was this line removed? > if (klp_is_module(obj)) { > if (strlen(obj->name) >= MODULE_NAME_LEN) > return -EINVAL; > name = obj->name; > > - klp_find_object_module(obj); > + /* > + * We do not want to block removal of patched modules and > + * therefore we do not take a reference here. The patches are > + * removed by klp_module_going() instead. > + * > + * Do not mess work of klp_module_coming() and > + * klp_module_going(). Note that the patch might still be > + * needed before klp_module_going() is called. Module functions > + * can be called even in the GOING state until mod->exit() > + * finishes. This is especially important for patches that > + * modify semantic of the functions. > + */ > + obj->mod = find_klp_module(obj->name); These comments don't make sense in this context, they should be kept with the code in find_klp_module(). -- Josh