All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Andrei Vagin <avagin@openvz.org>
Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org,
	Andrei Vagin <avagin@gmail.com>
Subject: Re: [PATCH dhowells/mount-context] fs: don't call fs_context->free() from fsmount()
Date: Tue, 31 Jul 2018 09:52:36 +0100	[thread overview]
Message-ID: <14901.1533027156@warthog.procyon.org.uk> (raw)
In-Reply-To: <20180731072928.2413-1-avagin@openvz.org>

Andrei Vagin <avagin@openvz.org> wrote:

> @@ -3435,9 +3435,6 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags, unsigned int, ms_flags
>  	 * do any memory allocation or anything like that at this point as we
>  	 * don't want to have to handle any errors incurred.
>  	 */
> -	if (fc->ops && fc->ops->free)
> -		fc->ops->free(fc);
> -	fc->fs_private = NULL;
>  	fc->s_fs_info = NULL;
>  	fc->sb_flags = 0;
>  	fc->sloppy = false;

This isn't the right fix.  The context needs to be reset at this point so that
it's prepared to be reinitialised into in the same state as one generated by
fspick().

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.

David

  reply	other threads:[~2018-07-31 10:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  7:29 [PATCH dhowells/mount-context] fs: don't call fs_context->free() from fsmount() Andrei Vagin
2018-07-31  8:52 ` David Howells [this message]
2018-07-31 17:34   ` Andrei Vagin
2018-07-31 20:56   ` David Howells
2018-07-31 22:48     ` Andrei Vagin
2018-08-01  0:42     ` David Howells
2018-08-01  5:53       ` Andrei Vagin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14901.1533027156@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=avagin@gmail.com \
    --cc=avagin@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.