[lkml]   [2003]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectflock races causes E_NOLCK
    I'm having a problem with flock on 2.4.18 kernel.
    The scenario is like this:

    parent process:
    open file
    fcntl(file, FD_SETFD, 1) // set CLOEXEC bit
    flock file
    fork/exec child process
    close file

    child process
    open the same file
    flock this file
    close file

    This sometimes (often) results in child process being unable to do any
    further locking with the error 37 (no locks available).
    Removing fcntl and doing an explicit close of all open file desciprotrs in
    the beginning of child leads to the same problem.

    Here is a post from Pat Knight descirbing similar problem:

    I can't directly map his problem onto mine, but it's pretty clear that
    somehow (usigned) current->locks is decremented when it is 0.

    For some reason, however, simplistic test program doens't hit this
    condition, so I suspect my analysis is not 100% correct. I'm sure, though,
    that current->locks is getting messed up somehow.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:35    [W:0.020 / U:1.260 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site