Date: Tue, 5 Oct 2010 15:39:26 +0900 From: Daichi GOTO <daichi@freebsd.org> To: Garrett Cooper <gcooper@FreeBSD.org> Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org Subject: Re: fcntl always fails to delete lock file, and PID is always -6464 Message-ID: <20101005153926.88b4c1e1.daichi@freebsd.org> In-Reply-To: <AANLkTi=w5ZAfRymSYbL6X37uyYX17J2dW8LHVcPXZ_%2Bb@mail.gmail.com> References: <20101004123725.65d09b9e.daichi@ongs.co.jp> <AANLkTinZg3n3wDUzQFPv_Gq1o2hswGL3%2B4o0brmTi0-h@mail.gmail.com> <20101004144927.36822f07.daichi@ongs.co.jp> <AANLkTimVcLVdULyAAJD-_TaC5OLj%2BaZVNa=%2BSaiN6PKv@mail.gmail.com> <20101005093826.17432b1e.daichi@ongs.co.jp> <AANLkTi=w5ZAfRymSYbL6X37uyYX17J2dW8LHVcPXZ_%2Bb@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Next step discussion engaged from this research I guess. Should we do change FreeBSD's fcntl(2) to return correct l_pid when called with F_SETLK? Or keep current behavior?? I want to hear other developers ideas and suggetions. On Mon, 4 Oct 2010 20:17:08 -0700 Garrett Cooper <gcooper@FreeBSD.org> wrote: > test_fcntl: fcntl: Resource temporarily unavailable > PID=1 has the lock > > Huh...? init has the file locked...? WTF?! > So assuming Occam's Razor, I did a bit more reading and it turns > out that l_pid is only populated when you call with F_GETLK: > > negative, l_start means end edge of the region. >>> The l_pid and l_sysid > fields are only used with F_GETLK to return the process ID of the process > holding a blocking lock and the system ID of the system that owns that > process. Locks created by the local system will have a system ID of > zero. <<< After a successful F_GETLK request, the value of l_whence is > SEEK_SET. > > Thus, after fixing the test app I'm getting a sensical value: -- Daichi GOTO 81-42-316-7945 | daichi@ongs.co.jp | http://www.ongs.co.jp LinkedIn: http://linkedin.com/in/daichigoto
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101005153926.88b4c1e1.daichi>