shuveb / io_uring-by-example

A companion repository for the io_uring by Example article series
MIT License
372 stars 56 forks source link

Fix `04_cp_liburing` to track write_left correctly #12

Closed hatoo closed 1 week ago

hatoo commented 3 years ago

Hi, 04_cp_liburing quits before writing file content in my environment. Since I think write_left in copy_file should be updated when actually wrote, I moved the line and it works fine in my environment.

Thanks.

adlternative commented 3 years ago

LGTM

amcn commented 2 weeks ago

I was investigating io_uring for a personal project and @shuveb's tutorial here is the first result on the world's most popular search engine when one searches for "io_uring tutorial".

The tutorial is well written and it helped me get to grips with the concepts of the API.That said, I immediately encountered the bug that this PR aims to resolve, along with a few memory leaks. Others have as well it seems going by #18.

@shuveb, could you review this PR, merge it and update the tutorial to take these fixes into account? It's unfortunate to have bugs like this in such widely read and otherwise excellent code.

shuveb commented 1 week ago

@amcn thanks for bumping this up. Merged now.

amcn commented 1 week ago

Thanks for the merge, and thanks for your excellent tutorial.