From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38090 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726596AbeGaWi5 (ORCPT ); Tue, 31 Jul 2018 18:38:57 -0400 From: David Howells In-Reply-To: <20180731173421.GA14809@outlook.office365.com> References: <20180731173421.GA14809@outlook.office365.com> <20180731072928.2413-1-avagin@openvz.org> <14901.1533027156@warthog.procyon.org.uk> To: Andrei Vagin Cc: dhowells@redhat.com, Andrei Vagin , linux-fsdevel@vger.kernel.org, Andrei Vagin Subject: Re: [PATCH dhowells/mount-context] fs: don't call fs_context->free() from fsmount() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22268.1533070605.1@warthog.procyon.org.uk> Date: Tue, 31 Jul 2018 21:56:45 +0100 Message-ID: <22269.1533070605@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Andrei Vagin wrote: > > I can do this two ways: (1) stick a flag in the context that says if > > ->free() needs calling, (2) make all the ->free() routines aware that they > > may see the reset state. I think (1) is less error prone. > > Does it mean that fc->fs_type->init_fs_context() should not be called > contexts which are created from fspick()? No. I've put a flag in the context that is set when ->init_fs_context() is called and cleared when ->free() is called. ->free() isn't called in the put routine if the flag isn't set. David