Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File shared/exclusive lock/unlock #85

Open
YoSTEALTH opened this issue Feb 24, 2020 · 10 comments
Open

File shared/exclusive lock/unlock #85

YoSTEALTH opened this issue Feb 24, 2020 · 10 comments
Labels
enhancement New feature or request

Comments

@YoSTEALTH
Copy link
Contributor

I am adding this here to keep track of this topic.

If we could have functions like io_uring_prep_lock() and io_uring_prep_unlock() for file locking/unlocking using something like IOSQE_IO_LINK to join few sequence together.

It would really be nice if this can be in Linux 5.6 :)

@axboe
Copy link
Owner

axboe commented Feb 24, 2020

5.6 is feature locked at this point, and not sure I'll have time to work on this for 5.7. So 5.8 is a more realistic target, I'm afraid.

@YoSTEALTH
Copy link
Contributor Author

Locking and unlocking is very important part of the project i wanted to use Liburing in :(

@axboe
Copy link
Owner

axboe commented Feb 24, 2020

Sorry, there's really nothing I can do, 5.6 is totally closed, it's bug fixes only after the merge window. And I've got other items I'm working on, hence I'm not going to promise anything for 5.7. Just trying to manage your expectations.

@YoSTEALTH
Copy link
Contributor Author

No worries... I will just have to rig a temp fix for now :)

@openalmeida
Copy link

Locking/unlocking and directory contents listing (getdents64 #111) is the first wave an totally uring drived io app will meet.

@dkadashev
Copy link
Contributor

@axboe if I was to try and implement flock support in io_uring, where should I look? Blocking the worker thread is a bad idea, so we probably need to somehow do a callback on lock acquisition instead. I suspect this is not possible at the moment and going to require quite a lot of quite involved work and I should stay away from it given my very limited kernel development experience? :)

@YoSTEALTH
Copy link
Contributor Author

flock is fd lock vs pid lock (commonly used). This could easily be used if fcntl was implemented #199 Its a chain of dependencies :)

Lock is only a lock as long as other software in your system also use the same method

@imanthaashan77
Copy link

I am adding this here to keep track of this topic.

If we could have functions like io_uring_prep_lock() and io_uring_prep_unlock() for file locking/unlocking using something like IOSQE_IO_LINK to join few sequence together.

It would really be nice if this can be in Linux 5.6 :)

are sucess exclusive unlock script ? you run own web ?

@YoSTEALTH
Copy link
Contributor Author

@imanthaashan77

are sucess exclusive unlock script ?

I am not sure what you are asking! None the less... I am currently using an atomic counter to reserve space, this way no external fd/pid lock/unlock system needs to be used, also its much faster, of course this is only viable within the software. External process can still alter the file.

you run own web ?

Lock/unlock is for file write not for web use.

@axboe axboe added the enhancement New feature or request label Jun 25, 2022
@ioquatix
Copy link
Contributor

Any way we can help with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants