if (arg.opts) {
char *optstr = strndup_user((char __user *)(unsigned long) arg.opts, 1 << 16);
+ char *ro, *rest;
+
+ /*
+ * If passed a "read_only" mount option, remove it because it is
+ * no longer a valid mount option, and the filesystem will be
+ * set "read_only" regardless.
+ */
+ ro = strstr(optstr, "read_only");
+ if (ro) {
+ rest = ro + strlen("read_only");
+ memmove(ro, rest, strlen(rest) + 1);
+ }
ret = PTR_ERR_OR_ZERO(optstr) ?:
bch2_parse_mount_opts(NULL, &thr->opts, optstr);
}
opt_set(thr->opts, stdio, (u64)(unsigned long)&thr->thr.stdio);
+ opt_set(thr->opts, read_only, 1);
/* We need request_key() to be called before we punt to kthread: */
opt_set(thr->opts, nostart, true);