From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:42241 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbeISHBt (ORCPT ); Wed, 19 Sep 2018 03:01:49 -0400 Date: Wed, 19 Sep 2018 10:26:26 +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 , Sergey Senozhatsky Subject: Re: [PATCH 14/33] vfs: Implement a filesystem superblock creation/configuration context [ver #11] Message-ID: <20180919012626.GA482@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> <80eb1ec0-7b61-debe-9e93-0176d3e2c76a@roeck-us.net> <20180919011236.GA407@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180919011236.GA407@jagdpanzerIV> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On (09/19/18 10:12), Sergey Senozhatsky wrote: > On (09/18/18 07:06), Guenter Roeck wrote: > > > 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. > > Right. If fc is always guaranteed to be properly zeroed-out. This is > true for kzalloc-ed fc's, but not necessarily so in any other case. What I mean was something like this void foo(void) { struct fs_context fc; fc.purpose = ...; fc.fs_type = ...; fc.root = ...; fc.sb_flags = ...; reconfigure_super(&fc); } -ss