Re: [PATCH 09/13] remove race between use and initialization of locks

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>
Date: Wednesday, December 26, 2007 - 3:28 pm

On Fri, Dec 21, 2007 at 10:00:40PM -0800, Andrew Morton wrote:
...
...

I don't think there is anything wrong with having a complete set of
initialization routines for a semaphore, but it's certainly easy
enough to go back to Alexey Dobriyan's original suggestion, which was
to simply move the initialization calls before register_chardev.

I will follow this email with a patch that does that.


There is a ring buffer of error messages.  Userland processes can read
these error messages by reading /dev/etherd/err, blocking if there are
no error messages to read yet.

The emsgs_sema semaphore is used to manage the reader(s) waiting for
error messages.  When there are sleepers waiting, "up" is used to wake
one up when a new error message is produced.  A reader gets a single
message, not just some text with a mixture of different errors.

If I do,

  cat /dev/etherd/err > /my/log/file

... then I can hit control-c or send a SIGTERM to stop it.


The counter will be incremented again if the process goes back to
sleep waiting for an error message, but the process might be getting
killed.  The counter is really just for sleeping readers.

-- 
  Ed L Cashin <ecashin@coraid.com>
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 01/13] bring driver version number to 47, Ed L. Cashin, (Thu Dec 20, 6:15 pm)
[PATCH 13/13] update copyright date, Ed L. Cashin, (Thu Dec 20, 6:16 pm)
Re: [PATCH 13/13] update copyright date, Andrew Morton, (Sat Dec 22, 2:03 am)
[PATCH 12/13] make error messages more specific, Ed L. Cashin, (Thu Dec 20, 6:16 pm)
[PATCH 11/13] the aoeminor doesn't need a long format, Ed L. Cashin, (Thu Dec 20, 6:15 pm)
[PATCH] aoe: document the behavior of /dev/etherd/err, Ed L. Cashin, (Wed Dec 26, 4:35 pm)
Re: [PATCH 09/13] remove race between use and initialization..., Ed L. Cashin, (Wed Dec 26, 3:28 pm)
[PATCH 08/13] only install new AoE device once, Ed L. Cashin, (Thu Dec 20, 6:15 pm)
[PATCH 05/13] eliminate goto and improve readability, Ed L. Cashin, (Thu Dec 20, 6:15 pm)
[PATCH 04/13] clean up udev configuration example, Ed L. Cashin, (Thu Dec 20, 6:15 pm)