Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:

- print more error messages for invalid mount option values

- prevent remount with v1 space cache for subpage filesystem

- fix hang during unmount when block group reclaim task is running

* tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: add error messages to all unrecognized mount options
btrfs: prevent remounting to v1 space cache for subpage mount
btrfs: fix hang during unmount when block group reclaim task is running

+51 -9
+11 -2
fs/btrfs/disk-io.c
··· 4632 4632 int ret; 4633 4633 4634 4634 set_bit(BTRFS_FS_CLOSING_START, &fs_info->flags); 4635 + 4636 + /* 4637 + * We may have the reclaim task running and relocating a data block group, 4638 + * in which case it may create delayed iputs. So stop it before we park 4639 + * the cleaner kthread otherwise we can get new delayed iputs after 4640 + * parking the cleaner, and that can make the async reclaim task to hang 4641 + * if it's waiting for delayed iputs to complete, since the cleaner is 4642 + * parked and can not run delayed iputs - this will make us hang when 4643 + * trying to stop the async reclaim task. 4644 + */ 4645 + cancel_work_sync(&fs_info->reclaim_bgs_work); 4635 4646 /* 4636 4647 * We don't want the cleaner to start new transactions, add more delayed 4637 4648 * iputs, etc. while we're closing. We can't use kthread_stop() yet ··· 4682 4671 cancel_work_sync(&fs_info->async_reclaim_work); 4683 4672 cancel_work_sync(&fs_info->async_data_reclaim_work); 4684 4673 cancel_work_sync(&fs_info->preempt_reclaim_work); 4685 - 4686 - cancel_work_sync(&fs_info->reclaim_bgs_work); 4687 4674 4688 4675 /* Cancel or finish ongoing discard work */ 4689 4676 btrfs_discard_cleanup(fs_info);
+40 -7
fs/btrfs/super.c
··· 763 763 compress_force = false; 764 764 no_compress++; 765 765 } else { 766 + btrfs_err(info, "unrecognized compression value %s", 767 + args[0].from); 766 768 ret = -EINVAL; 767 769 goto out; 768 770 } ··· 823 821 case Opt_thread_pool: 824 822 ret = match_int(&args[0], &intarg); 825 823 if (ret) { 824 + btrfs_err(info, "unrecognized thread_pool value %s", 825 + args[0].from); 826 826 goto out; 827 827 } else if (intarg == 0) { 828 + btrfs_err(info, "invalid value 0 for thread_pool"); 828 829 ret = -EINVAL; 829 830 goto out; 830 831 } ··· 888 883 break; 889 884 case Opt_ratio: 890 885 ret = match_int(&args[0], &intarg); 891 - if (ret) 886 + if (ret) { 887 + btrfs_err(info, "unrecognized metadata_ratio value %s", 888 + args[0].from); 892 889 goto out; 890 + } 893 891 info->metadata_ratio = intarg; 894 892 btrfs_info(info, "metadata ratio %u", 895 893 info->metadata_ratio); ··· 909 901 btrfs_set_and_info(info, DISCARD_ASYNC, 910 902 "turning on async discard"); 911 903 } else { 904 + btrfs_err(info, "unrecognized discard mode value %s", 905 + args[0].from); 912 906 ret = -EINVAL; 913 907 goto out; 914 908 } ··· 943 933 btrfs_set_and_info(info, FREE_SPACE_TREE, 944 934 "enabling free space tree"); 945 935 } else { 936 + btrfs_err(info, "unrecognized space_cache value %s", 937 + args[0].from); 946 938 ret = -EINVAL; 947 939 goto out; 948 940 } ··· 1026 1014 break; 1027 1015 case Opt_check_integrity_print_mask: 1028 1016 ret = match_int(&args[0], &intarg); 1029 - if (ret) 1017 + if (ret) { 1018 + btrfs_err(info, 1019 + "unrecognized check_integrity_print_mask value %s", 1020 + args[0].from); 1030 1021 goto out; 1022 + } 1031 1023 info->check_integrity_print_mask = intarg; 1032 1024 btrfs_info(info, "check_integrity_print_mask 0x%x", 1033 1025 info->check_integrity_print_mask); ··· 1046 1030 goto out; 1047 1031 #endif 1048 1032 case Opt_fatal_errors: 1049 - if (strcmp(args[0].from, "panic") == 0) 1033 + if (strcmp(args[0].from, "panic") == 0) { 1050 1034 btrfs_set_opt(info->mount_opt, 1051 1035 PANIC_ON_FATAL_ERROR); 1052 - else if (strcmp(args[0].from, "bug") == 0) 1036 + } else if (strcmp(args[0].from, "bug") == 0) { 1053 1037 btrfs_clear_opt(info->mount_opt, 1054 1038 PANIC_ON_FATAL_ERROR); 1055 - else { 1039 + } else { 1040 + btrfs_err(info, "unrecognized fatal_errors value %s", 1041 + args[0].from); 1056 1042 ret = -EINVAL; 1057 1043 goto out; 1058 1044 } ··· 1062 1044 case Opt_commit_interval: 1063 1045 intarg = 0; 1064 1046 ret = match_int(&args[0], &intarg); 1065 - if (ret) 1047 + if (ret) { 1048 + btrfs_err(info, "unrecognized commit_interval value %s", 1049 + args[0].from); 1050 + ret = -EINVAL; 1066 1051 goto out; 1052 + } 1067 1053 if (intarg == 0) { 1068 1054 btrfs_info(info, 1069 1055 "using default commit interval %us", ··· 1081 1059 break; 1082 1060 case Opt_rescue: 1083 1061 ret = parse_rescue_options(info, args[0].from); 1084 - if (ret < 0) 1062 + if (ret < 0) { 1063 + btrfs_err(info, "unrecognized rescue value %s", 1064 + args[0].from); 1085 1065 goto out; 1066 + } 1086 1067 break; 1087 1068 #ifdef CONFIG_BTRFS_DEBUG 1088 1069 case Opt_fragment_all: ··· 2010 1985 if (ret) 2011 1986 goto restore; 2012 1987 1988 + /* V1 cache is not supported for subpage mount. */ 1989 + if (fs_info->sectorsize < PAGE_SIZE && btrfs_test_opt(fs_info, SPACE_CACHE)) { 1990 + btrfs_warn(fs_info, 1991 + "v1 space cache is not supported for page size %lu with sectorsize %u", 1992 + PAGE_SIZE, fs_info->sectorsize); 1993 + ret = -EINVAL; 1994 + goto restore; 1995 + } 2013 1996 btrfs_remount_begin(fs_info, old_opts, *flags); 2014 1997 btrfs_resize_thread_pool(fs_info, 2015 1998 fs_info->thread_pool_size, old_thread_pool_size);