mbox series

[v2,0/7] fuse: Some fixes for submounts

Message ID 20210604161156.408496-1-groug@kaod.org (mailing list archive)
Headers show
Series fuse: Some fixes for submounts | expand

Message

Greg Kurz June 4, 2021, 4:11 p.m. UTC
v2:

- add an extra fix (patch 2) : mount is now added to the list before
  unlocking sb->s_umount
- set SB_BORN just before unlocking sb->s_umount, just like it would
  happen when using fc_mount() (Max)
- don't allocate a FUSE context for the submounts (Max)
- introduce a dedicated context ops for submounts
- add a extra cleanup : simplify the code even more with fc_mount()

v1:

While working on adding syncfs() support in FUSE, I've hit some severe
bugs with submounts (a crash and an infinite loop). The fix for the
crash is straightforward (patch 1), but the fix for the infinite loop
is more invasive : as suggested by Miklos, a simple bug fix is applied
first (patch 2) and the final fix (patch 3) is applied on top.

Greg Kurz (7):
  fuse: Fix crash in fuse_dentry_automount() error path
  fuse: Fix crash if superblock of submount gets killed early
  fuse: Fix infinite loop in sget_fc()
  fuse: Add dedicated filesystem context ops for submounts
  fuse: Call vfs_get_tree() for submounts
  fuse: Switch to fc_mount() for submounts
  fuse: Make fuse_fill_super_submount() static

 fs/fuse/dir.c       | 58 ++++++---------------------------------------
 fs/fuse/fuse_i.h    | 14 ++++-------
 fs/fuse/inode.c     | 56 +++++++++++++++++++++++++++++++++++++++++--
 fs/fuse/virtio_fs.c |  3 +++
 4 files changed, 69 insertions(+), 62 deletions(-)

Comments

Max Reitz June 8, 2021, 3:52 p.m. UTC | #1
On 04.06.21 18:11, Greg Kurz wrote:
> v2:
>
> - add an extra fix (patch 2) : mount is now added to the list before
>    unlocking sb->s_umount
> - set SB_BORN just before unlocking sb->s_umount, just like it would
>    happen when using fc_mount() (Max)
> - don't allocate a FUSE context for the submounts (Max)
> - introduce a dedicated context ops for submounts
> - add a extra cleanup : simplify the code even more with fc_mount()
>
> v1:
>
> While working on adding syncfs() support in FUSE, I've hit some severe
> bugs with submounts (a crash and an infinite loop). The fix for the
> crash is straightforward (patch 1), but the fix for the infinite loop
> is more invasive : as suggested by Miklos, a simple bug fix is applied
> first (patch 2) and the final fix (patch 3) is applied on top.

Thanks a lot for these patches. I’ve had a style nit on patch 6, but 
other than that, looks nice to me.

Max
Greg Kurz June 9, 2021, 7:46 a.m. UTC | #2
On Tue, 8 Jun 2021 17:52:13 +0200
Max Reitz <mreitz@redhat.com> wrote:

> On 04.06.21 18:11, Greg Kurz wrote:
> > v2:
> >
> > - add an extra fix (patch 2) : mount is now added to the list before
> >    unlocking sb->s_umount
> > - set SB_BORN just before unlocking sb->s_umount, just like it would
> >    happen when using fc_mount() (Max)
> > - don't allocate a FUSE context for the submounts (Max)
> > - introduce a dedicated context ops for submounts
> > - add a extra cleanup : simplify the code even more with fc_mount()
> >
> > v1:
> >
> > While working on adding syncfs() support in FUSE, I've hit some severe
> > bugs with submounts (a crash and an infinite loop). The fix for the
> > crash is straightforward (patch 1), but the fix for the infinite loop
> > is more invasive : as suggested by Miklos, a simple bug fix is applied
> > first (patch 2) and the final fix (patch 3) is applied on top.
> 
> Thanks a lot for these patches. I’ve had a style nit on patch 6, but 
> other than that, looks nice to me.
> 

Thanks a lot for the review !

Cheers,

--
Greg

> Max
>