From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:45540 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729152AbeIRPMr (ORCPT ); Tue, 18 Sep 2018 11:12:47 -0400 Date: Tue, 18 Sep 2018 18:40:53 +0900 From: Sergey Senozhatsky To: David Howells Cc: Guenter Roeck , viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Sergey Senozhatsky Subject: Re: [PATCH 14/33] vfs: Implement a filesystem superblock creation/configuration context [ver #11] Message-ID: <20180918094053.GA417@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> <20180918090722.GA463@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180918090722.GA463@jagdpanzerIV> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On (09/18/18 18:07), Sergey Senozhatsky wrote: > 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) I guess I was pretty lucky to have leading zeroes in that fc. David, do you want to add a macro which would make `struct fs_context fc' misuse less possible? There are 3 users right now who don't use vfs_new_fs_context(), and none of them appear to properly set all of `struct fs_context fc' members. This can cause problems in the future, right? fs/namespace.c: struct fs_context fc = { fs/super.c: struct fs_context fc = { fs/super.c: struct fs_context fc = { -ss