From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752472AbdLGEma (ORCPT ); Wed, 6 Dec 2017 23:42:30 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50092 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252AbdLGEm2 (ORCPT ); Wed, 6 Dec 2017 23:42:28 -0500 Date: Wed, 6 Dec 2017 20:42:22 -0800 From: "Paul E. McKenney" To: Stephen Rothwell Cc: Bart Van Assche , "Martin K. Petersen" , Linus Kernel Mailing List , Linux Next Mailing List , Pavel Tikhomirov , Josh Triplett Subject: Re: linux-next: build failure after merge of the scsi-mkp tree Reply-To: paulmck@linux.vnet.ibm.com References: <20171207145728.57cd9ac4@canb.auug.org.au> <1512619169.3298.3.camel@wdc.com> <20171207152521.0036b131@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171207152521.0036b131@canb.auug.org.au> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17120704-0052-0000-0000-0000028DF092 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008163; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000244; SDB=6.00956567; UDB=6.00483555; IPR=6.00736599; BA=6.00005729; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018394; XFM=3.00000015; UTC=2017-12-07 04:42:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120704-0053-0000-0000-000052D6E92A Message-Id: <20171207044222.GK7829@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-06_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712070071 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 07, 2017 at 03:25:21PM +1100, Stephen Rothwell wrote: > Hi Bart, > > [cc'ing some RCU people ...] > > On Thu, 7 Dec 2017 03:59:30 +0000 Bart Van Assche wrote: > > > > On Thu, 2017-12-07 at 14:57 +1100, Stephen Rothwell wrote: > > > After merging the scsi-mkp tree, today's linux-next build (x86_64 > > > allmodconfig) failed like this: > > > > > > ERROR: "init_rcu_head" [drivers/scsi/scsi_mod.ko] undefined! > > > ERROR: "destroy_rcu_head" [drivers/scsi/scsi_mod.ko] undefined! > > > > > > Caused by commit > > > > > > ac90420f17c9 ("scsi: core: Ensure that the SCSI error handler gets woken up") > > > > > > I have used the scsi-mkp tree from next-20171206 for today. > > > > Does that mean I'm the first one who added RCU code to the SCSI core? > > The only other uses of init_rcu_head() are in drivers/iommu/intel-svm.c > and kernel/irq/irqdesc.c. destroy_rcu_head() appears to not be used > anywhere ... The key point is that Bart appears to be the first to try using them in a module, for which exports are needed. Does the patch below help? Thanx, Paul ------------------------------------------------------------------------ commit cde4691a3a4591e7355295dd62610e3262159002 Author: Paul E. McKenney Date: Wed Dec 6 20:39:38 2017 -0800 rcu: Export init_rcu_head() and destroy_rcu_head() to GPL modules Use of init_rcu_head() and destroy_rcu_head() from modules results in the following build-time error: ERROR: "init_rcu_head" [drivers/scsi/scsi_mod.ko] undefined! ERROR: "destroy_rcu_head" [drivers/scsi/scsi_mod.ko] undefined! This commit therefore adds EXPORT_SYMBOL_GPL() for each to allow them to be used by GPL-licensed kernel modules. Reported-by: Bart Van Assche Reported-by: Stephen Rothwell Signed-off-by: Paul E. McKenney diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 8d591d8411fe..4c4d26e9a67b 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -422,11 +422,13 @@ void init_rcu_head(struct rcu_head *head) { debug_object_init(head, &rcuhead_debug_descr); } +EXPORT_SYMBOL_GPL(init_rcu_head); void destroy_rcu_head(struct rcu_head *head) { debug_object_free(head, &rcuhead_debug_descr); } +EXPORT_SYMBOL_GPL(destroy_rcu_head); static bool rcuhead_is_static_object(void *addr) {