Re: [RFC PATCH v1 0/5] Ensure io_uring data structure consistentcy in liburing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/6/22 14:12, Ammar Faizi wrote:

Hi,

This is an RFC for liburing-2.3.

## Introduction:
This series adds compile time assertions for liburing. They are taken
from the io_uring source in the kernel tree. The point of this series
is to make sure the shared struct is consistent between the kernel
space and user space.


## Implementation detail:
We use `static_assert()` macro from <assert.h> that can yield compile
error if the expression given to it evaluates to false. This way we
can create a `BUILD_BUG_ON()` macro that we usually use inside the
kernel. The assertions are placed inside a header file named
build_assert.h, this header is included via compile flag `-include`
when compiling the core liburing sources.


## How to maintain this?
This is pretty much easy to maintain, we just need to sync the
`BUILD_BUG_ON()` macro calls that check the shared struct from
io_uring. See patch #5 for detail.



Looks good to me,
Acked-by: Hao Xu <howeyxu@xxxxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux