diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2006-07-01 04:36:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 09:56:03 -0700 |
commit | 912ad92220038b0bb67e3310b8447e4d8802d581 (patch) | |
tree | a4131156931d9ebd5022d969ffbbf3c6bc51e055 /ipc | |
parent | 47e5243afe0bd2a1aca1e1f05dfbcc214267fbc9 (diff) | |
download | linux-912ad92220038b0bb67e3310b8447e4d8802d581.tar.gz linux-912ad92220038b0bb67e3310b8447e4d8802d581.tar.xz |
[PATCH] uml: fix not_dead_yet when directory is in bad state
The bug occurred to me when a UML left an empty ~/.uml/Sarge-norm folder -
when trying to reuse not_dead_yet() failed one of its check. The comment
says that's ok and means that we can take the directory, but while normally
not_dead_yet() removes it and returns 0 (i.e. go on, use this), on failure
it returns 0 but forgets to remove it. The fix is to remove it anytime
we're going to return 0.
But since "not_dead_yet" didn't make the interface so clear, causing this
bug, and I couldn't find a convenient name for the mix of things it did, I
split it into two parts:
is_umdir_used() - returns a boolean, contains all checks of not_dead_yet()
umdir_take_if_dead - tries to remove the dir unless it's used - returns
whether it removed it, that is we now own it.
With this changes the control flow is IMHO a bit clearer and needs less
comment for control flow.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions