Re: [PATCH] v9fs: handle async processing of F_SETLK with FL_SLEEP flag

From: Vasily Averin
Date: Fri Dec 24 2021 - 07:07:48 EST


On 24.12.2021 10:31, Dominique Martinet wrote:
> If that process is made asynchronous, we need a way to run more
> 9p-specific code in that one's lm_grant callback, so we can proceed onto
> the second step which is...
>
> - send the lock request to the 9p server and wait for its reply
> (note that the current code is always synchronous here: even if you
> request SETLK without the SLEEP flag you can be made to wait here.
> I have work in the closest to make some requests asynchronous, so
> locking could be made asynchronous when that lands, but my code
> introduced a race somewhere I haven't had the time to fix so this
> improvement will come later)
>
> What would you suggest with that?

It isn't necessary to make request asynchronous,
it's enough to avoid blocking locks.
As far as I understand blocking does not happen for SETLK command,
so it should be enough to chenge first part and call non-blocking
posix_file_lock() instead of blocking locks_lock_file_wait().

It would be great to make processing of 2nd part asynchronous too,
but I think it looks like over-engineering, because we even are not
100% sure that someone really uses this functionality.

Thank you,
Vasily Averin