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

[EROFS] Align with the block size of overlayBD #351

Closed
wants to merge 1 commit into from

Conversation

salvete
Copy link
Contributor

@salvete salvete commented Oct 21, 2024

The inconsistency in the default block sizes between OverlayBD and EROFS can lead to issues during segment mapping. This patch aligns with the block size of overlaybd for mapping (i.e., OverlayBD's 512-byte size) to overcome this inconsistency.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

The inconsistency in the default block sizes between OverlayBD
and EROFS can lead to issues during segment mapping. This patch
aligns with the block size of overlaybd for mapping (i.e.,
OverlayBD's 512-byte size) to overcome this inconsistency.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
LSMT::RemoteMapping lba;

cnt = sscanf(line, "%" PRIx64" %x %" PRIx64 "%08u\n", &blkaddr, &nblocks, &toff, &zeroedlen);
if (!(cnt == 3 || cnt == 4))
Copy link
Contributor

@hsiangkao hsiangkao Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should ignore if cnt > 4 (e.g. more hints which we don't care)

cnt = sscanf(line, "%" PRIx64" %x %" PRIx64 "%08u\n", &blkaddr, &nblocks, &toff, &zeroedlen);
if (!(cnt == 3 || cnt == 4))
LOG_ERRNO_RETURN(0, -1, "fail to read block list");

lba.offset = blkaddr * blksz;
lba.count = nblocks * blksz;
Copy link
Contributor

@hsiangkao hsiangkao Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lba.count = nblocks * blksz - round_down_blk(zeroedlen); ?

Are you sure that is round_up_blk?

LSMT::RemoteMapping lba;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zeroedlen = 0?

@salvete salvete closed this Oct 22, 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

Successfully merging this pull request may close these issues.

2 participants