Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3721794ioo; Mon, 30 May 2022 08:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq/sdkI/Zy3fm31cFpBYTnrCyJIqj2TZtTBRUWvHaIz1/Fx0iw0vuEENGS0Cf1c+NUc/av X-Received: by 2002:a05:6402:401b:b0:42b:5bbf:4b88 with SMTP id d27-20020a056402401b00b0042b5bbf4b88mr43824712eda.238.1653923635225; Mon, 30 May 2022 08:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653923635; cv=none; d=google.com; s=arc-20160816; b=Jpg2khfQMJ49CuX62TUn81xYJu5a2Y3UiqYRpTozTvFyDoC7FmivFHG3KU2YFfpRHq icujN2wdJcWkhKxvgSA10kiEWq44/t7pL2zRP3LWgO/2GPsZK74fLW3c4SN4rbBGjqXz X8oXpbeT0wGeGJ2sHZipPl/JlqzQpu4Q69/ykqvyRwgzMjs6cOCSI+wvt2G7M75NzRtl uKzFL6oWOfaxeVNwbDhya6BeidYqwqSyHyB01pfBg5aOM+A4/u2ld1inri6qgSrc7RCR WHbnDFaa7XwPm3CRFOcZTW/OeL3EpkLsqI+Gq6QAFukqoPMf2gZ4W7N+bVdK9tvws8Ds GRQQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FV6ixAgxONc97M+SI7U62WEMY00WEGgbcBEcX4KiHVQ=; b=O6MhlNhYq9ah9VF9FAGSd0Vb+Gn0HWoSgzIxBuJo1PnG5FXkWczc1BtKfQcT+om6Os QCrSZmufUQRb+ziGEb3R2DwhoZQxaFK2tK6RgIOMd/t5s1CamPCyPC/pzf5LEt3tq4c9 KNyYjWPYUFFBK1AwI4crkn0Lkw+1I4c/R7DNMMJF0wDQMsQKF774I9lNaufwc4w+/3Ql pBvhVqjvvwXfBHwnZHwM+MLs5Y2upG0HIUCehL6imSfOtr/fWXOcwfWROgNCsKMBFvHI 6eP6vXDNlvcFuQPtXv0ZJOaxuTZm37HhUesRLNwzjtp0tXQ3lNx6pyaLbHD2NNnUUdw/ KQaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4wohNBWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a1709065d0b00b006fead2c3278si11221995ejt.192.2022.05.30.08.13.27; Mon, 30 May 2022 08:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4wohNBWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232642AbiE3F7O (ORCPT + 99 others); Mon, 30 May 2022 01:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbiE3F7N (ORCPT ); Mon, 30 May 2022 01:59:13 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D1726D858; Sun, 29 May 2022 22:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=FV6ixAgxONc97M+SI7U62WEMY00WEGgbcBEcX4KiHVQ=; b=4wohNBWacToPDLeDkf4XlTX1IE TXygurGB/B02n3EPQE3XWySSgIxr9iB/ux9RnN6rt3Qj874QlM1HRTDvdbUUlZ+pWGcDE98Ln8zMY GKOMGJG7QJxbQXdMSYoPUeDgA5waiScQCX5KbdDnpLc7u8qYXKxVTsnSnxCy+8RsjpafBZseLJfdS JkZGSnll1MYz6PQP87Crb898/AuJ5zDtykIZRX7t7EG6Qv57dqNHCOgCbzEt/abFujge2edN+AVSR cp6T58S2dRdLKc6X4x+ImbS3GX5l0Mlg7z7KU50Q8FlYi6s7BPvk7vGGCurhFp/NjilCP7AyXsddR 1zfiU1Pg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvYQp-005U5K-Aq; Mon, 30 May 2022 05:59:11 +0000 Date: Sun, 29 May 2022 22:59:11 -0700 From: Christoph Hellwig To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Stephen Bates , Martin Oliveira , David Sloan Subject: Re: [PATCH v2 12/17] md/raid5-cache: Move struct r5l_log definition to raid5-log.h Message-ID: References: <20220526163604.32736-1-logang@deltatee.com> <20220526163604.32736-13-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220526163604.32736-13-logang@deltatee.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2022 at 10:35:59AM -0600, Logan Gunthorpe wrote: > Move struct r5l_log definition to raid5-log.h. While this reduces > encapsulation, it is necessary for the definition of r5l_log to be > public so that rcu_access_pointer() can be used on conf-log in the > next patch. > > rcu_access_pointer(p) doesn't technically dereference the log pointer > however, it does use typeof(*p) and some older GCC versions (anything > earlier than gcc-10) will wrongly try to dereference the structure: > > include/linux/rcupdate.h:384:9: error: dereferencing pointer to > incomplete type ‘struct r5l_log’ > > typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \ > ^ > > include/linux/rcupdate.h:495:31: note: in expansion of > macro ‘__rcu_access_pointer’ > > #define rcu_access_pointer(p) __rcu_access_pointer((p), > __UNIQUE_ID(rcu), __rcu) > > To prevent this, simply provide the definition where > rcu_access_pointer() may be used. What about just moving any code that does the rcu_access_pointer on conf->log to raid5-cache.c and doing an out of line call for it instead?