goto fail_cleaner;
        }
 
-       if (!btrfs_test_opt(fs_info, NOSSD) &&
-           !fs_info->fs_devices->rotating) {
-               btrfs_set_and_info(fs_info, SSD, "enabling ssd optimizations");
-       }
-
-       /*
-        * For devices supporting discard turn on discard=async automatically,
-        * unless it's already set or disabled. This could be turned off by
-        * nodiscard for the same mount.
-        *
-        * The zoned mode piggy backs on the discard functionality for
-        * resetting a zone. There is no reason to delay the zone reset as it is
-        * fast enough. So, do not enable async discard for zoned mode.
-        */
-       if (!(btrfs_test_opt(fs_info, DISCARD_SYNC) ||
-             btrfs_test_opt(fs_info, DISCARD_ASYNC) ||
-             btrfs_test_opt(fs_info, NODISCARD)) &&
-           fs_info->fs_devices->discardable &&
-           !btrfs_is_zoned(fs_info)) {
-               btrfs_set_and_info(fs_info, DISCARD_ASYNC,
-                                  "auto enabling async discard");
-       }
-
        ret = btrfs_read_qgroup_config(fs_info);
        if (ret)
                goto fail_trans_kthread;
 
                btrfs_set_opt(fs_info->mount_opt, SPACE_CACHE);
 }
 
+static void set_device_specific_options(struct btrfs_fs_info *fs_info)
+{
+       if (!btrfs_test_opt(fs_info, NOSSD) &&
+           !fs_info->fs_devices->rotating)
+               btrfs_set_opt(fs_info->mount_opt, SSD);
+
+       /*
+        * For devices supporting discard turn on discard=async automatically,
+        * unless it's already set or disabled. This could be turned off by
+        * nodiscard for the same mount.
+        *
+        * The zoned mode piggy backs on the discard functionality for
+        * resetting a zone. There is no reason to delay the zone reset as it is
+        * fast enough. So, do not enable async discard for zoned mode.
+        */
+       if (!(btrfs_test_opt(fs_info, DISCARD_SYNC) ||
+             btrfs_test_opt(fs_info, DISCARD_ASYNC) ||
+             btrfs_test_opt(fs_info, NODISCARD)) &&
+           fs_info->fs_devices->discardable &&
+           !btrfs_is_zoned(fs_info))
+               btrfs_set_opt(fs_info->mount_opt, DISCARD_ASYNC);
+}
+
 static int parse_rescue_options(struct btrfs_fs_info *info, const char *options)
 {
        char *opts;
                goto error;
        }
 
+       set_device_specific_options(fs_info);
+
        if (sb->s_root) {
                btrfs_close_devices(fs_devices);
                if ((fc->sb_flags ^ sb->s_flags) & SB_RDONLY)