From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:33413 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728467AbeIROjI (ORCPT ); Tue, 18 Sep 2018 10:39:08 -0400 Date: Tue, 18 Sep 2018 18:07:22 +0900 From: Sergey Senozhatsky To: Guenter Roeck Cc: David Howells , viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH 14/33] vfs: Implement a filesystem superblock creation/configuration context [ver #11] Message-ID: <20180918090722.GA463@jagdpanzerIV> References: <20180911220743.GA13208@roeck-us.net> <20180911174641.GA15149@roeck-us.net> <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> <153313714181.13253.304098108512966976.stgit@warthog.procyon.org.uk> <27113.1536702746@warthog.procyon.org.uk> <32382.1536707855@warthog.procyon.org.uk> <20180911235403.GA10107@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180911235403.GA10107@roeck-us.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, On (09/11/18 16:54), Guenter Roeck wrote: > On Wed, Sep 12, 2018 at 12:17:35AM +0100, David Howells wrote: > > Guenter Roeck wrote: > > > > > [ 8.507672] RIP: 0010:reconfigure_super+0x47/0x210 > > > > Can you tell me the file and line this corresponds to? > > > I don't know, but some debugging shows that fc->ops == NULL. This NULL derefs linux-next. Emergency (sysrq remount/reboot): emergency_remount() do_emergency_remount() do_emergency_remount_callback() reconfigure_super() At fc->ops dereference: 981 if (fc->ops->reconfigure) { ^^^^^^^^^ 982 retval = fc->ops->reconfigure(fc); 983 if (retval == 0) { 984 security_sb_reconfigure(fc); So the check either better be if (fc->ops && fc->ops->reconfigure) Or, we need to set ->ops properly. But I'm not sure if invoking ->init_fs_context() from emergency-reboot path is going to work well all the time. --- fs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/super.c b/fs/super.c index efb0567c8389..e2e03c47c817 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1017,6 +1017,7 @@ int reconfigure_super(struct fs_context *fc) static void do_emergency_remount_callback(struct super_block *sb) { struct fs_context fc = { + .ops = &legacy_fs_context_ops, .purpose = FS_CONTEXT_FOR_EMERGENCY_RO, .fs_type = sb->s_type, .root = sb->s_root, --- -ss