@@ -49,6 +49,7 @@ int rt_spec; /* Realtime dev specified as option */
int convert_lazy_count; /* Convert lazy-count mode on/off */
int lazy_count; /* What to set if to if converting */
bool skip_freesp_check_on_upgrade; /* do not enable */
+bool allow_rmapbt_upgrade_with_reflink; /* add rmapbt when reflink already on */
bool features_changed; /* did we change superblock feature bits? */
bool add_inobtcount; /* add inode btree counts to AGI */
bool add_bigtime; /* add support for timestamps up to 2486 */
@@ -90,6 +90,7 @@ extern int rt_spec; /* Realtime dev specified as option */
extern int convert_lazy_count; /* Convert lazy-count mode on/off */
extern int lazy_count; /* What to set if to if converting */
extern bool skip_freesp_check_on_upgrade; /* do not enable */
+extern bool allow_rmapbt_upgrade_with_reflink; /* add rmapbt when reflink already on */
extern bool features_changed; /* did we change superblock feature bits? */
extern bool add_inobtcount; /* add inode btree counts to AGI */
extern bool add_bigtime; /* add support for timestamps up to 2486 */
@@ -283,7 +283,8 @@ set_rmapbt(
exit(0);
}
- if (xfs_has_reflink(mp) && !add_reflink) {
+ if (xfs_has_reflink(mp) && !add_reflink &&
+ !allow_rmapbt_upgrade_with_reflink) {
printf(
_("Reverse mapping btrees cannot be added when reflink is enabled.\n"));
exit(0);
@@ -47,6 +47,7 @@ enum o_opt_nums {
BLOAD_NODE_SLACK,
NOQUOTA,
SKIP_FREESP_CHECK,
+ ALLOW_RMAPBT_UPGRADE_WITH_REFLINK,
O_MAX_OPTS,
};
@@ -61,6 +62,7 @@ static char *o_opts[] = {
[BLOAD_NODE_SLACK] = "debug_bload_node_slack",
[NOQUOTA] = "noquota",
[SKIP_FREESP_CHECK] = "debug_skip_freesp_check_on_upgrade",
+ [ALLOW_RMAPBT_UPGRADE_WITH_REFLINK] = "debug_allow_rmapbt_upgrade_with_reflink",
[O_MAX_OPTS] = NULL,
};
@@ -334,6 +336,15 @@ process_args(int argc, char **argv)
do_log(
_("WARNING: Allowing filesystem upgrades to proceed without free space check. THIS MAY DESTROY YOUR FILESYSTEM!!!\n"));
break;
+ case ALLOW_RMAPBT_UPGRADE_WITH_REFLINK:
+ if (!val)
+ do_abort(
+ _("-o debug_allow_rmapbt_upgrade_with_reflink requires a parameter\n"));
+ allow_rmapbt_upgrade_with_reflink = (int)strtol(val, NULL, 0);
+ if (allow_rmapbt_upgrade_with_reflink)
+ do_log(
+ _("WARNING: Allowing filesystem upgrade to rmapbt when reflink enabled. THIS MAY DESTROY YOUR FILESYSTEM!!!\n"));
+ break;
default:
unknown('o', val);
break;