Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS03 requires a minimum of 15 or 16 roots if --no-bdr-defect-management is specified #79

Closed
jpovixwm opened this issue Nov 20, 2023 · 2 comments

Comments

@jpovixwm
Copy link
Contributor

When calculating the RS03 layout, dvdisaster tries to find the smallest medium size that will result in at least 8 roots. However, even if the --no-bdr-defect-management CLI flag is specified, the function RS03Layout *CalcRS03Layout(Image *image, int target) still performs its checks using defect-management-enabled medium sizes:

else if(get_roots(dataSectors, BD_SL_SIZE) >= 8) {
/* Single layered BD */
if (Closure->noBdrDefectManagement)
lay->mediumCapacity = BD_SL_SIZE_NODM;
else
lay->mediumCapacity = BD_SL_SIZE;
}
else if(get_roots(dataSectors, BD_DL_SIZE) >= 8) {
/* Double layered BD */
if (Closure->noBdrDefectManagement)
lay->mediumCapacity = BD_DL_SIZE_NODM;
else
lay->mediumCapacity = BD_DL_SIZE;
}
else if(get_roots(dataSectors, BDXL_TL_SIZE) >= 8) {
/* Triple layered BDXL */
if (Closure->noBdrDefectManagement)
lay->mediumCapacity = BDXL_TL_SIZE_NODM;
else
lay->mediumCapacity = BDXL_TL_SIZE;
}
else {
/* Quadruple layered BDXL */
if (Closure->noBdrDefectManagement)
lay->mediumCapacity = BDXL_QL_SIZE_NODM;
else
lay->mediumCapacity = BDXL_QL_SIZE;
}

This means that the NODM variant of a medium size will only be chosen if the equivalent DM-enabled medium size yields at least 8 roots.
I've tried obtaining the maximum image sizes that will result in a NODM variant being chosen, and came up with this table:

Medium size Max ISO sectors Roots Redundancy
BD_SL_SIZE_NODM 11408740 15 6.25%
BD_DL_SIZE_NODM 22817482 15 6.25%
BDXL_TL_SIZE_NODM 45635950 15 6.25%
BDXL_QL_SIZE_NODM 58271740 16 6.69%

However, I'm not sure whether this is a bug or intended behavior, as I know that using a redundancy lower than 20% triggers a warning message anyway, so maybe these redundancies of ~6.25% are too small to be useful anyway?

@speed47
Copy link
Owner

speed47 commented Nov 21, 2023

Thanks for your report!

You're right, the above code is incorrect, and yields sub-optimal results when defect management is disabled. This was not intentional.
That said, a redundancy of 6.25% is not really a good idea, but it's still better than nothing, i.e. as you said, sub-20% get a warning printed, and if the user ignores it, we'll make the assumption that they know what they're doing. If for some reason you have to burn only one BD and you happen to have 6% space remaining, it's still better to fill it up with parity data than not doing anything with it!

speed47 added a commit that referenced this issue Jan 18, 2024
* fix: suboptimal layout for RS03 w/o defect management (#79)

Co-authored-by: jpovixwm <53523617+jpovixwm@users.noreply.github.com>
@speed47
Copy link
Owner

speed47 commented Jan 19, 2024

fixed by #80, thanks for your report (and review!)

@speed47 speed47 closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants