tech-kern archive

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

Re: fcntl() F_GETLK semantics vs. test t_vnops.c



J. Hannken-Illjes wrote:
> The test fcntl_getlock_pids() from fs/vfs/t_vnops.c assumes
> fcntl(fd, F_GETLK, &lock) returns the blocking lock with the
> lowest start offset.
> 
> Our documentation and POSIX.1 document it returning the
> "first lock that blocks" but doesn't call for any specific order.

I think it's an ambiguity in POSIX. I wrote the test in assumption
that "first" means a lock with the lowest start offset but my
intention was to interate over *all* locks in any order. I think
it's still possible with the current behaviour but with a less
straightforward implementation: rather then moving linearly through
a file, you will have to build a tree.

Alex


Home | Main Index | Thread Index | Old Index