hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/fuse/inode.c
....@@ -713,6 +713,7 @@
713713 fc->pid_ns = get_pid_ns(task_active_pid_ns(current));
714714 fc->user_ns = get_user_ns(user_ns);
715715 fc->max_pages = FUSE_DEFAULT_MAX_PAGES_PER_REQ;
716
+ fc->max_pages_limit = FUSE_MAX_MAX_PAGES;
716717
717718 INIT_LIST_HEAD(&fc->mounts);
718719 list_add(&fm->fc_entry, &fc->mounts);
....@@ -1059,7 +1060,7 @@
10591060 fc->abort_err = 1;
10601061 if (arg->flags & FUSE_MAX_PAGES) {
10611062 fc->max_pages =
1062
- min_t(unsigned int, FUSE_MAX_MAX_PAGES,
1063
+ min_t(unsigned int, fc->max_pages_limit,
10631064 max_t(unsigned int, arg->max_pages, 1));
10641065 }
10651066 if (IS_ENABLED(CONFIG_FUSE_DAX) &&
....@@ -1617,7 +1618,7 @@
16171618 struct fuse_mount *fm = get_fuse_mount_super(sb);
16181619 bool last;
16191620
1620
- if (fm) {
1621
+ if (sb->s_root) {
16211622 last = fuse_mount_remove(fm);
16221623 if (last)
16231624 fuse_conn_destroy(fm);