All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Daniil Lunev <dlunev@chromium.org>
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
	fuse-devel@lists.sourceforge.net, tytso@mit.edu,
	miklos@szeredi.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] FUSE: Retire superblock on force unmount
Date: Tue, 17 May 2022 22:32:38 +0000	[thread overview]
Message-ID: <YoQihi4OMjJj2Mj0@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <YoQfls6hFcP3kCaH@zeniv-ca.linux.org.uk>

On Tue, May 17, 2022 at 10:20:06PM +0000, Al Viro wrote:
> On Thu, May 12, 2022 at 08:29:10AM +1000, Daniil Lunev wrote:
> > Force unmount of FUSE severes the connection with the user space, even
> > if there are still open files. Subsequent remount tries to re-use the
> > superblock held by the open files, which is meaningless in the FUSE case
> > after disconnect - reused super block doesn't have userspace counterpart
> > attached to it and is incapable of doing any IO.
> 
> 	Why not simply have those simply rejected by fuse_test_super()?
> Looks like that would be much smaller and less invasive patch...
> Confused...

... because Miklos had suggested that, apparently ;-/  I disagree -
that approach has more side effects.  "mount will skip that sucker" is,
AFAICS, the only effect of modiyfing test_super callback(s); yours, OTOH...

Note that generic_shutdown_super() is *not* called while superblock is
mounted anywhere.  And it doesn't get to eviction from the list while it still
has live dentries.  Or inodes, for that matter.

So this
        if (sb->s_bdi != &noop_backing_dev_info) {
		if (sb->s_iflags & SB_I_PERSB_BDI)
			bdi_unregister(sb->s_bdi);
		bdi_put(sb->s_bdi);
		sb->s_bdi = &noop_backing_dev_info;
	}
is almost certainly not safe to be done on a live superblock.

  reply	other threads:[~2022-05-17 22:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 22:29 [PATCH v2 0/2] Prevent re-use of FUSE superblock after force unmount Daniil Lunev
2022-05-11 22:29 ` [PATCH v2 1/2] fs/super: function to prevent super re-use Daniil Lunev
2022-05-11 22:29 ` [PATCH v2 2/2] FUSE: Retire superblock on force unmount Daniil Lunev
2022-05-17 22:20   ` Al Viro
2022-05-17 22:32     ` Al Viro [this message]
2022-05-17 23:27       ` Daniil Lunev
2022-05-18 11:57       ` Miklos Szeredi
2022-05-18 22:55         ` Daniil Lunev
2022-05-23  0:25           ` Daniil Lunev
2022-05-24 14:22             ` Miklos Szeredi
2022-05-24 22:44               ` Daniil Lunev
2022-05-30  1:41                 ` 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=YoQihi4OMjJj2Mj0@zeniv-ca.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=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 \
    /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.