2021-05-25 20:32:26

by Greg Kurz

[permalink] [raw]
Subject: [PATCH 0/4] fuse: Some fixes for submounts

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 (4):

fuse: Fix crash in fuse_dentry_automount() error path

fuse: Fix infinite loop in sget_fc()

fuse: Call vfs_get_tree() for submounts

fuse: Make fuse_fill_super_submount() static



fs/fuse/dir.c | 46 ++++++++++---------------------------------

fs/fuse/fuse_i.h | 9 +++------

fs/fuse/inode.c | 48 +++++++++++++++++++++++++++++++++++++++++++--

fs/fuse/virtio_fs.c | 3 +++

4 files changed, 62 insertions(+), 44 deletions(-)



--

2.31.1





2021-05-25 20:33:08

by Greg Kurz

[permalink] [raw]
Subject: [PATCH 4/4] fuse: Make fuse_fill_super_submount() static

This function used to be called from fuse_dentry_automount(). This code
was moved to fuse_get_tree_submount() in the same file since then. It
is unlikely there will ever be another user. No need to be extern in
this case.

Signed-off-by: Greg Kurz <[email protected]>
---
fs/fuse/fuse_i.h | 9 ---------
fs/fuse/inode.c | 4 ++--
2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index d7fcf59a6a0e..e2f5c8617e0d 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -1081,15 +1081,6 @@ void fuse_send_init(struct fuse_mount *fm);
*/
int fuse_fill_super_common(struct super_block *sb, struct fuse_fs_context *ctx);

-/*
- * Fill in superblock for submounts
- * @sb: partially-initialized superblock to fill in
- * @parent_fi: The fuse_inode of the parent filesystem where this submount is
- * mounted
- */
-int fuse_fill_super_submount(struct super_block *sb,
- struct fuse_inode *parent_fi);
-
/*
* Get the mountable root for the submount
* @fsc: superblock configuration context
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 433ca2b13046..f591956c01b3 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1275,8 +1275,8 @@ static void fuse_sb_defaults(struct super_block *sb)
sb->s_xattr = fuse_no_acl_xattr_handlers;
}

-int fuse_fill_super_submount(struct super_block *sb,
- struct fuse_inode *parent_fi)
+static int fuse_fill_super_submount(struct super_block *sb,
+ struct fuse_inode *parent_fi)
{
struct fuse_mount *fm = get_fuse_mount_super(sb);
struct super_block *parent_sb = parent_fi->inode.i_sb;
--
2.31.1

2021-05-27 13:29:59

by Max Reitz

[permalink] [raw]
Subject: Re: [Virtio-fs] [PATCH 4/4] fuse: Make fuse_fill_super_submount() static

On 25.05.21 17:02, Greg Kurz wrote:
> This function used to be called from fuse_dentry_automount(). This code
> was moved to fuse_get_tree_submount() in the same file since then. It
> is unlikely there will ever be another user. No need to be extern in
> this case.
>
> Signed-off-by: Greg Kurz <[email protected]>
> ---
> fs/fuse/fuse_i.h | 9 ---------
> fs/fuse/inode.c | 4 ++--
> 2 files changed, 2 insertions(+), 11 deletions(-)

Reviewed-by: Max Reitz <[email protected]>