From: Karel Zak <kzak@redhat.com>
To: kerolasa@gmail.com
Cc: "Mantas M." <grawity@gmail.com>, util-linux@vger.kernel.org
Subject: Re: lslocks – "failed to parse pid: 'WRITE'"
Date: Tue, 12 Feb 2013 11:35:49 +0100 [thread overview]
Message-ID: <20130212103549.GF20408@x2.net.home> (raw)
In-Reply-To: <CAG27Bk2dO1ztSAy47=j+nmG+v5YuMCBa0i4eorLWw2sFWRT2Pg@mail.gmail.com>
On Mon, Feb 11, 2013 at 10:42:36PM +0000, Sami Kerola wrote:
> Subject: [PATCH] lslocks: print waiting state when necessary
> Organization: Lastminute.com
>
> Earlier output was primarily unexpected.
>
> $ flock foo -c "sleep 100" & flock foo -c "sleep 100" & flock foo -c
> "sleep 100" & lslocks
> [1] 22352
> [2] 22353
> [3] 22354
> lslocks: failed to parse pid: 'WRITE'
>
> This commit adds WAITING mode to output listing. The locks which failed
> with earlier version will look the following.
>
> COMMAND PID TYPE SIZE MODE M START END PATH
> [...]
> flock 22354 FLOCK 0B WAITING 0 0 0
> /home/src/util-linux/foo
> flock 22352 FLOCK 0B WAITING 0 0 0
> /home/src/util-linux/foo
> flock 22353 FLOCK 0B WRITE 0 0 0
> /home/src/util-linux/foo
It's probably good idea to add information that the process is blocked,
but I don't think that use WAITING in the MODE column is the right way.
We will lost the original information about the lock mode.
It would be better to add a new column (e.g. BLOCKED).
We can also add a prefix to MODE, for example ">WRITE" for blocked
process. The disadvantage is that ">WRITE" is not backwardly compatible.
(Hmm.. lslocks was introduced in release 2.22 and it's broken now ...
maybe it's not so big problem ;-)
It would be also nice to have --blocked command line option to list
blocked processes only.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2013-02-12 10:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130212103549.GF20408@x2.net.home \
--to=kzak@redhat.com \
--cc=grawity@gmail.com \
--cc=kerolasa@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox