Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5281270imm; Tue, 18 Sep 2018 07:10:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYBG64j3Xg1cR0SBcsxSrVOiy5RhB/IQLBdZ62mktRdDCEt19Oiz5vuuOGD56RiMHrS2g1Z X-Received: by 2002:a65:6499:: with SMTP id e25-v6mr27086753pgv.224.1537279850315; Tue, 18 Sep 2018 07:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537279850; cv=none; d=google.com; s=arc-20160816; b=MIIbJqcH9JOwqme8rTROiJOwRNH5HXcbPSqzHAdXWjUuPHJaTR4+9/XC9VPD3GwBO1 26lbTFd8zzCQokTzqY8YEO/Ue824XTbtH8cDlV+982JADyauWAtmUl0UkPpH2Wo/I9N+ +1EogFyafupHap6D7o1Mr81WpDEAng2NOS6h4u4pW2pccV4MlJ3M4zy6sKVdm9wFLsNP ISnwWth35xqhf6VL2Q3YJBicsh9G12w2Ww35oJ2R4LwHtcixTYy+7RrJN+bJIlOjYDmq 8uenxnYE5fyD/Hbc0/+7XZpB9HIZqZhgKAocJESpE4bHbE6+pMoTNcthS0zLFZjraj7J 7u8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=EqGTw5VlQC4sXFlC4ADXCrpnP4pKxK9Sbd5coQ2ibQk=; b=IfZ/uCGph+NiVB2o5XXkAwv0oelSV1o40Nw1hbyTIxOHP7dquvFz/fewkTI5R4PJGR pdTwqFl18F5w87tIeonI9ZUEpsVhqxdJ/AYvUk0N+LtGfX0Frb/Aau9Aoo4BEUSjuf1t GEGpUT3M//gQx7XPxUVAZ724wyrK5xpJttm8G5+DlUG9PRBbAfT8Vd6TlKoeb9xpBLba kiIkEyVeGVNNAwtf58u1Vehx+e+Kxb8akE+ObXTklkX2Ro0+BYY0U00GiDpBKzZfEXbS VSfBe93ZOvNcgjZdS0oxth0TpXrj66P5+Qioo+JloXIzg/lsd5lw/u9BbEF0eA/8XxLs uA3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nZOKrFsB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si19165962pgb.608.2018.09.18.07.10.22; Tue, 18 Sep 2018 07:10:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nZOKrFsB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729705AbeIRTjr (ORCPT + 99 others); Tue, 18 Sep 2018 15:39:47 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39739 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728575AbeIRTjq (ORCPT ); Tue, 18 Sep 2018 15:39:46 -0400 Received: by mail-pl1-f194.google.com with SMTP id w14-v6so1065065plp.6; Tue, 18 Sep 2018 07:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EqGTw5VlQC4sXFlC4ADXCrpnP4pKxK9Sbd5coQ2ibQk=; b=nZOKrFsB+Na1aszcollO8h6XodKw5aWc4MpaHT9odxdDDtiFC+FO/aKwmZGp487Oi9 FMGf5xvRedS/yfjxPHMT7sgsCPaPrYt51Z3sDMyO8hZ2EyKZlD6ayBeKyGmEWtigXj6s 2ku//+/0eteU246b7ZjgFhyA0mlkda+Bz+WDwf6WDYGVdDuEyqzF6AMm2Iqn4sidIhVF pSGDOIpvgzyodZ5mzdbpgGj6YW/V/CgYJNApSmq/1IvC2Pn6womaTGgQnAmfHtrI2KTX UiIOa297bLIGASWobaITuFlD6NEpsxVXXbuKTh0elZe7dZ6m9O/NGG5quRav5zfUx/zS Y06g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EqGTw5VlQC4sXFlC4ADXCrpnP4pKxK9Sbd5coQ2ibQk=; b=k7nsnbJk3rusxla75zkp9UqOvNvkvAZjFQ9TC1j5t/8h29vIF0iRc2QAbSqHnOlwcc NNmllbyayG5eZbcCBK9E2bZDYO68ubfzM1aV5ffgABa1SwXnycfiPKqeIkxneexo/PiR fLwmzJ/Xyfy9uWtQKLYEbdAbTnMQWynVNWf++qLnotVjHJAVMhvp9HwAAvndzwC3fOhG UK1pJfkSlhCHpeiq35Pb1JEbboQrKpeG3cexKZ1Ir1BTg88dihtt+8jv/MKxMyBKMcBh gbWLVKY/ZGUzwPfnJmtBP6TspdnPT3nFH/Q+jyY6B3BtQFiYC8+LWwg/UUwMr8SyrOC0 Xeig== X-Gm-Message-State: APzg51Dqi1FlG0dnpxpvqh8gwt8TCtIGsu8zhX+N9xGqEe7oxh/bwuhU BSgiYxOM5E0tA0MF3IG50Aw6fmoN X-Received: by 2002:a17:902:b189:: with SMTP id s9-v6mr29654195plr.188.1537279620748; Tue, 18 Sep 2018 07:07:00 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id u43-v6sm26573239pgn.81.2018.09.18.07.06.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 07:06:59 -0700 (PDT) Subject: Re: [PATCH 14/33] vfs: Implement a filesystem superblock creation/configuration context [ver #11] To: Sergey Senozhatsky Cc: David Howells , viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt 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> <20180918090722.GA463@jagdpanzerIV> From: Guenter Roeck Message-ID: <80eb1ec0-7b61-debe-9e93-0176d3e2c76a@roeck-us.net> Date: Tue, 18 Sep 2018 07:06:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180918090722.GA463@jagdpanzerIV> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/18/2018 02:07 AM, Sergey Senozhatsky wrote: > 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) > Since there are multiple instances of fs_context where fc->ops isn't set, this check would be needed wherever fc->ops is dereferenced. Guenter > 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 >