public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* lslocks – "failed to parse pid: 'WRITE'"
@ 2013-02-07 14:42 Mantas M.
  2013-02-11 22:42 ` Sami Kerola
  0 siblings, 1 reply; 11+ messages in thread
From: Mantas M. @ 2013-02-07 14:42 UTC (permalink / raw)
  To: util-linux

When one process is holding an exclusive lock on a file, and other
processes are waiting for the lock to be released, the contents of
/proc/locks look like this:

$ cat /proc/locks
1: FLOCK  ADVISORY  WRITE 431143 00:0f:6325223 0 EOF
1: -> FLOCK  ADVISORY  WRITE 405209 00:0f:6325223 0 EOF
1: -> FLOCK  ADVISORY  WRITE 399578 00:0f:6325223 0 EOF
1: -> FLOCK  ADVISORY  WRITE 434120 00:0f:6325223 0 EOF
2: FLOCK  ADVISORY  WRITE 359765 08:04:28180839 0 EOF
3: FLOCK  ADVISORY  WRITE 359765 08:04:28180837 0 EOF
4: POSIX  ADVISORY  WRITE 434729 08:04:8653261 0 EOF
4: -> POSIX  ADVISORY  WRITE 434737 08:04:8653261 0 EOF
5: FLOCK  ADVISORY  WRITE 359765 08:04:28180836 0 EOF
6: ...

If I try to run `lslocks`, it fails to parse the "->" lines and exits
with an error message:

    lslocks: failed to parse pid: 'WRITE'

Can be reproduced by:

touch foo & flock foo -c "sleep 100" & flock foo -c "sleep 100" &
touch foo & lckdo -w foo sleep 100 & lckdo -w foo sleep 100 &

-- 
Mantas Mikulėnas <grawity@gmail.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-14 15:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-07 14:42 lslocks – "failed to parse pid: 'WRITE'" Mantas M.
2013-02-11 22:42 ` Sami Kerola
2013-02-11 23:23   ` Mantas Mikulėnas
2013-02-12 11:12     ` Karel Zak
2013-02-12 11:23       ` Sami Kerola
2013-02-12 11:56         ` Bernhard Voelker
2013-02-12 13:18           ` Karel Zak
2013-02-14 15:02             ` Karel Zak
2013-02-12 13:20         ` Karel Zak
2013-02-14 15:44         ` Karel Zak
2013-02-12 10:35   ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox