crimson/os/seastore: write "seastore block device" signature in write_superblock#64333
crimson/os/seastore: write "seastore block device" signature in write_superblock#64333
Conversation
|
jenkins test make check |
Matan-B
left a comment
There was a problem hiding this comment.
This seems like the correct approach. Left few suggestions and let's wait for @cyx1231st approval.
Probably worth mentioning that this comes to help ceph volume's has_seastore_label helper.
| [=, &device](auto &bp) | ||
| { | ||
| bufferlist bl; | ||
| bl.append(SUPERBLOCK_MAGIC); |
There was a problem hiding this comment.
Is there a reason not to move this into block_sm_superblock_t encode/decode?
There was a problem hiding this comment.
There is no specific reason
There was a problem hiding this comment.
Agree with matan, this should be part of block_sm_superblock_t, then the change will affect the other tools relying on block_sm_superblock_t immediately, which is actually better.
see #63604
There was a problem hiding this comment.
@cyx1231st I have updated the note why can;t we add signature via DENC.
| constexpr const char* SUPERBLOCK_MAGIC = "seastore block device\n"; | ||
| constexpr size_t SUPERBLOCK_MAGIC_LEN = strlen(SUPERBLOCK_MAGIC); | ||
|
|
There was a problem hiding this comment.
nit: Can we name this label instead of magic?
cyx1231st
left a comment
There was a problem hiding this comment.
The change is straightforward.
If we are not going to support seastore label in the other 2 superblocks in this PR, for completeness, please add TODO comments to them to clarify that they won't be compatible to (which) related features.
| [=, &device](auto &bp) | ||
| { | ||
| bufferlist bl; | ||
| bl.append(SUPERBLOCK_MAGIC); |
There was a problem hiding this comment.
Agree with matan, this should be part of block_sm_superblock_t, then the change will affect the other tools relying on block_sm_superblock_t immediately, which is actually better.
see #63604
|
jenkins test make check |
| 1 << (std::numeric_limits<device_id_t>::digits - 1); | ||
|
|
||
| constexpr const char* SEASTORE_SUPERBLOCK_SIGN = "seastore block device\n"; | ||
| constexpr size_t SEASTORE_SUPERBLOCK_SIGN_LEN = strlen(SEASTORE_SUPERBLOCK_SIGN); |
There was a problem hiding this comment.
/home/jenkins-build/build/workspace/ceph-pull-requests/src/crimson/os/seastore/seastore_types.h:122:18: error: constexpr variable 'SEASTORE_SUPERBLOCK_SIGN_LEN' must be initialized by a constant expression
122 | constexpr size_t SEASTORE_SUPERBLOCK_SIGN_LEN = strlen(SEASTORE_SUPERBLOCK_SIGN);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jenkins-build/build/workspace/ceph-pull-requests/src/crimson/os/seastore/seastore_types.h:122:49: note: non-constexpr function 'strlen' cannot be used in a constant expression
| // Write the SEASTORE_SUPERBLOCK_SIGN at offset 0 before | ||
| // encoding the superblock. If the signature is added inside | ||
| // the block_sm_superblock_t structure (via DENC), it won't be | ||
| // written at offset 0 because DENC encoding add some metadata. | ||
| // Therefore prepend the signature to the bufferlist before | ||
| // encoding the superblock sothat signature always appears at the | ||
| // start of the written data. |
There was a problem hiding this comment.
nit: This sections here would probably better fit in the commit message.
We can add a more specific comment here such as:
// encode SEASTORE_SUPERBLOCK_SIGN at offset 0 before encoding anything else
| // Write the SEASTORE_SUPERBLOCK_SIGN at offset 0 before | ||
| // encoding the superblock. If the signature is added inside | ||
| // the block_sm_superblock_t structure (via DENC), it won't be | ||
| // written at offset 0 because DENC encoding add some metadata. |
There was a problem hiding this comment.
If DENC encodes additional data, can we use encode/decode instead so that we could move this into encode/decode?
As @cyx1231st mentioned earlier encoding additional data without properly decoding it might break future users (i.e objectstore-tool).
There was a problem hiding this comment.
I had already discussed with @cyx1231st he agreed with patch.
There was a problem hiding this comment.
As disscussed, it's simpler to place SEASTORE_SUPERBLOCK_SIGN directly at the start of the device without headers, like bluestore.
We can switch to encode/decode if possible.
|
jenkins test make check |
| // Write the SEASTORE_SUPERBLOCK_SIGN at offset 0 before | ||
| // encoding the superblock. If the signature is added inside | ||
| // the block_sm_superblock_t structure (via DENC), it won't be | ||
| // written at offset 0 because DENC encoding add some metadata. |
There was a problem hiding this comment.
As disscussed, it's simpler to place SEASTORE_SUPERBLOCK_SIGN directly at the start of the device without headers, like bluestore.
We can switch to encode/decode if possible.
|
^ can you fix the commit title as well? Also better to explain why we need this PR in the commit message (the requirement, e.g. ceph-volume). |
done |
|
jenkins test make check |
Write the SEASTORE_SUPERBLOCK_SIGN at offset 0 before encoding the superblock. If the signature is added inside the block_sm_superblock_t structure (via DENC), it won't be written at offset 0 because DENC encoding add some metadata. Therefore prepend the signature to the bufferlist before encoding the superblock sothat signature always appears at the start of the written data Fixes: https://tracker.ceph.com/issues/71954 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
jenkins test make check |
|
Hey Mohit, can you please review the run to verify that all the failures are known? |
|
jenkins test api |
|
jenkins test make check |
There are total two types of failure
I have checked the failures were specific to the ceph branch version, on latest main branch these failures are resolved so we can say it is ok. |
For 1, it's probably due to the branch being a bit outdated - I'm ok with merging since the issue also appeared in bluestore which is not affected by this PR (and most of the test did pass). |
To validate the seastore device by cephadm write a signature "seastore block device" during superblock creation.
Fixes: https://tracker.ceph.com/issues/71954
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition