Skip to content

dmabuf: Convert oflags to fflags in dma_buf_export - #483

Open
yizishun wants to merge 1 commit into
freebsd:masterfrom
yizishun:dmabuf/fix-export-fflags
Open

dmabuf: Convert oflags to fflags in dma_buf_export#483
yizishun wants to merge 1 commit into
freebsd:masterfrom
yizishun:dmabuf/fix-export-fflags

Conversation

@yizishun

@yizishun yizishun commented Jul 8, 2026

Copy link
Copy Markdown

Since Linux has no concept of internal fflags, exp_info->flags contains oflags (e.g., O_RDWR). However, FreeBSD's finit() expects internal fflags (e.g., FREAD, FWRITE).

Passing O_RDWR (0x02) directly causes it to be evaluated purely as FWRITE (0x02) in FreeBSD, dropping the read permission entirely. Fix this by wrapping the flags with the FFLAGS() macro.

Since Linux has no concept of internal fflags, exp_info->flags contains
oflags (e.g., O_RDWR). However, FreeBSD's finit() expects internal
fflags (e.g., FREAD, FWRITE).

Passing O_RDWR (0x02) directly causes it to be evaluated purely as
FWRITE (0x02) in FreeBSD, dropping the read permission entirely.  Fix
this by wrapping the flags with the FFLAGS() macro.
@yizishun yizishun mentioned this pull request Jul 8, 2026
22 tasks
@aokblast
aokblast requested a review from dumbbell July 11, 2026 13:21

@aokblast aokblast left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

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.

3 participants