From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:55565 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752525AbdGMS6l (ORCPT ); Thu, 13 Jul 2017 14:58:41 -0400 Date: Thu, 13 Jul 2017 11:58:40 -0700 From: Matthew Wilcox To: Jay Lan Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] export symbol mount_lock Message-ID: <20170713185840.GB4469@bombadil.infradead.org> References: <855c5c7d-586a-3b35-76f8-ddca4fae1410@nasa.gov> <20170713071533.GA25560@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jul 13, 2017 at 11:24:01AM -0700, Jay Lan wrote: > On 07/13/2017 12:15 AM, Christoph Hellwig wrote: > > On Wed, Jul 12, 2017 at 02:40:11PM -0700, Jay Lan wrote: > > > Hi all, > > > > > > I was writing a livepatch patch, but compilation failed in creating the .ko > > > because mount_lock is "undefined." > > > > > > The mount_lock is defined globally in fs/namespace.c > > > __cacheline_aligned_in_smp DEFINE_SEQLOCK(mount_lock); > > > > > > and extern in fs/mount.h. > > > extern seqlock_t mount_lock; > > > > > > If there is a reason that mount_lock should not be EXPORT_SYMBOL_GPL, please > > > advise; otherwise, I propose the patch to export this symbol. > > Because there is no %$^$^ reason to use it from a module ever? > Is livepatch a good reason? Besides security fixes, livepatch is a good tool > to use for debugging and providing a temporary fix on production systems > (until next release from vendors) I know this argument is not strong, but at > least mount_lock is declared globally. Yes? Something I've done in the past as a local hack when a symbol I wanted wasn't exported is: extern seqlock_t *mount_lock_p; module_param(mount_lock_p, charp, 0); and then pass the address (from /proc/kallsyms) as a module parameter at load time.