Skip to content

Add read-only FS_IOC_FSGETXATTR support - #1657

Draft
a-shannon wants to merge 1 commit into
bytecodealliance:mainfrom
a-shannon:a-shannon/linux-fsgetxattr-readonly
Draft

Add read-only FS_IOC_FSGETXATTR support#1657
a-shannon wants to merge 1 commit into
bytecodealliance:mainfrom
a-shannon:a-shannon/linux-fsgetxattr-readonly

Conversation

@a-shannon

Copy link
Copy Markdown

Summary

Add a read-only ioctl_fsgetxattr wrapper using the generated Linux
struct fsxattr definition.

This change:

  • introduces a non-exhaustive Fsxattr result and named FsxattrFlags;
  • returns all five non-padding fields from FS_IOC_FSGETXATTR;
  • preserves unnamed returned FS_XFLAG_* bits through normal flag operations;
  • zero-initializes the complete kernel object, including reserved padding;
  • derives the ioctl opcode from the generated ABI type;
  • adds no setter; and
  • adds the missing CASEFOLD, ENCRYPTED, and VERITY names to IFlags.

Testing

Focused local validation recorded for both the linux_raw and use-libc
configurations:

  • four integration tests covering flag handling, ABI layout, wrapper-versus-raw
    result parity, and unsupported-descriptor errno parity;
  • the field-conversion and unknown-bit operator unit test;
  • the generated-constant opcode check; and
  • focused Clippy with warnings denied.

The broader local Clippy run remained blocked only by unchanged diagnostics in
timespec.rs. This does not claim repository-wide Clippy, MSRV, CI, or
cross-architecture runtime validation.

Related work

This is distinct from #1624, which adds FICLONERANGE. Both changes append
tests to tests/fs/ioctl.rs, so whichever lands second will need a small
test-file rebase.

Expose Fsxattr, FsxattrFlags, and ioctl_fsgetxattr using the kernel ABI definition. Preserve unknown returned flag bits and test layout, opcode, syscall parity, and error behavior.
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.

1 participant