linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH] fscrypt: move the call to fscrypt_destroy_keyring() into ->put_super()
Date: Tue, 5 Dec 2023 22:38:12 -0800	[thread overview]
Message-ID: <ZXAW1BREPtCSUz4W@infradead.org> (raw)
In-Reply-To: <20231206001325.13676-1-ebiggers@kernel.org>

On Tue, Dec 05, 2023 at 04:13:24PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> btrfs, which is planning to add support for fscrypt, has a variety of
> asynchronous things it does with inodes that can potentially last until
> ->put_super, when it shuts everything down and cleans up all async work.
> Consequently, btrfs needs the call to fscrypt_destroy_keyring() to
> happen either after or within ->put_super.
> 
> Meanwhile, f2fs needs the call to fscrypt_destroy_keyring() to happen
> either *before* or within ->put_super, due to the dependency of
> f2fs_get_devices() on ->s_fs_info still existing.

And that means f2fs should free ->s_fs_info in ->kill_sb after
the call to shutdown_generic_super.

So the right thing here is:

 - change f2fs to free ->s_fs_info later
 - move down fscrypt_destroy_keyring in the keneric code to happen
   after ->put_super


  parent reply	other threads:[~2023-12-06  6:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06  0:13 [PATCH] fscrypt: move the call to fscrypt_destroy_keyring() into ->put_super() Eric Biggers
2023-12-06  0:21 ` Josef Bacik
2023-12-06  6:38 ` Christoph Hellwig [this message]
2023-12-06  6:44   ` Eric Biggers
2023-12-06  7:16     ` Christoph Hellwig
2023-12-09 21:29       ` Eric Biggers
2023-12-11 16:42         ` Christoph Hellwig

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=ZXAW1BREPtCSUz4W@infradead.org \
    --to=hch@infradead.org \
    --cc=ebiggers@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).