linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniil Lunev <dlunev@chromium.org>
To: linux-fsdevel@vger.kernel.org, miklos@szeredi.hu,
	viro@zeniv.linux.org.uk, hch@infradead.org, tytso@mit.edu
Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Daniil Lunev <dlunev@chromium.org>
Subject: [PATCH v3 0/2] Prevent re-use of FUSE superblock after force unmount
Date: Mon, 30 May 2022 11:39:56 +1000	[thread overview]
Message-ID: <20220530013958.577941-1-dlunev@chromium.org> (raw)

Force unmount of fuse severes the connection between FUSE driver and its
userspace counterpart. However, open file handles will prevent the
superblock from being reclaimed. An attempt to remount the filesystem at
the same endpoint will try re-using the superblock, if still present.
Since the superblock re-use path doesn't go through the fs-specific
superblock setup code, its state in FUSE case is already disfunctional,
and that will prevent the mount from succeeding.

Changes in v3:
- Back to state tracking from v1
- Use s_iflag to mark superblocked ignored
- Only unregister private bdi in retire, without freeing

Changes in v2:
- Remove super from list of superblocks instead of using a flag

Daniil Lunev (2):
  fs/super: function to prevent super re-use
  FUSE: Retire superblock on force unmount

 fs/fuse/inode.c    |  7 +++++--
 fs/super.c         | 32 ++++++++++++++++++++++++++++----
 include/linux/fs.h |  2 ++
 3 files changed, 35 insertions(+), 6 deletions(-)

-- 
2.31.0


             reply	other threads:[~2022-05-30  1:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30  1:39 Daniil Lunev [this message]
2022-05-30  1:39 ` [PATCH v3 1/2] fs/super: function to prevent super re-use Daniil Lunev
2022-05-31  7:24   ` Christoph Hellwig
2022-06-01  1:11     ` Daniil Lunev
2022-05-30  1:39 ` [PATCH v3 2/2] FUSE: Retire superblock on force unmount Daniil Lunev

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=20220530013958.577941-1-dlunev@chromium.org \
    --to=dlunev@chromium.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).