2022-06-01 21:36:35

by Daniil Lunev

[permalink] [raw]
Subject: [PATCH v4 0/2] Prevent re-use of FUSE superblock after force unmount

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 v4:
- Simplify condition according to Christoph Hellwig's comments.

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 | 28 ++++++++++++++++++++++++++--
include/linux/fs.h | 2 ++
3 files changed, 33 insertions(+), 4 deletions(-)

--
2.31.0



2022-06-09 00:32:44

by Daniil Lunev

[permalink] [raw]
Subject: Re: [PATCH v4 0/2] Prevent re-use of FUSE superblock after force unmount

Hi Miklos and Alexander,
Do you have any more concerns or comments regarding the patchset or do
you think we can proceed with it?
--Daniil

On Wed, Jun 1, 2022 at 11:11 AM Daniil Lunev <[email protected]> wrote:
>
> 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 v4:
> - Simplify condition according to Christoph Hellwig's comments.
>
> 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 | 28 ++++++++++++++++++++++++++--
> include/linux/fs.h | 2 ++
> 3 files changed, 33 insertions(+), 4 deletions(-)
>
> --
> 2.31.0
>