Skip to content

Conversation

@brenns10
Copy link
Member

Three small fixes here. Two relate to string encoding and decoding. We've sometimes done a bit of unnecessary (or even harmful) str.decode() operations. Many kinds of data in the kernel (filenames, printk buffer) don't have guaranteed encodings, so decoding with the utf-8 encoding is not the right call. The right way is either to keep the data in bytes if possible, or else use escape_ascii_string() if we expect it to be text and we want to include it in text-mode/string output.

The last fix is for a change in 6.16 that has broken the test framework.

Linux only requires that filenames cannot contain the byte '/' or the
NUL byte. They do not have any specific encoding and aren't even
guaranteed to be text. Thus, using bytes.decode() is not reliable. Use
escape_ascii_string() when handling dentry names and paths.

Signed-off-by: Stephen Brennan <[email protected]>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 15, 2025
It was removed and defaulted to zero in 6.16. This allows us existing
code to continue working with compatibility for old kernels. The
"Bounce" field in meminfo will likely remain hard-coded to zero for a
long time anyway.

Signed-off-by: Stephen Brennan <[email protected]>
@brenns10 brenns10 merged commit 4ff6c22 into oracle-samples:main Sep 15, 2025
4 checks passed
@brenns10 brenns10 deleted the fix_dentry_decode branch September 15, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants