@@ -1080,6 +1080,17 @@ static struct btrfs_flag_map btrfs_opt_map[Opt_err] = {
[Opt_ref_verify] = INIT_MAP(REF_VERIFY),
};
+static int btrfs_fc_validate(struct fs_context *fc)
+{
+ struct btrfs_fs_context *ctx = fc->fs_private;
+
+ /* Check for current option against current flag */
+ if (btrfs_test_opt(ctx, NOLOGREPLAY) && !(fc->sb_flags & SB_RDONLY))
+ return invalf(fc, "nologreplay must be used with ro mount option");
+
+ return 0;
+}
+
static int btrfs_fc_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
int opt;