linux-stable/arch/um
Paolo 'Blaisorblade' Giarrusso 912ad92220 [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>
2006-07-01 09:56:03 -07:00
..
drivers Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
include Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
kernel [PATCH] uml: make copy_*_user atomic 2006-07-01 09:56:03 -07:00
os-Linux [PATCH] uml: fix not_dead_yet when directory is in bad state 2006-07-01 09:56:03 -07:00
scripts [PATCH] uml: cleanup unprofile expression and build infrastructure 2006-05-01 18:17:45 -07:00
sys-i386 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
sys-ia64 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sys-ppc Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sys-x86_64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
config.release Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
defconfig [PATCH] uml: update defconfig 2006-05-01 18:17:44 -07:00
Kconfig [PATCH] uml: skas0 support for 2G/2G hosts 2006-05-01 18:17:43 -07:00
Kconfig.char [PATCH] uml: Rename Kconfig files to be like the other arches 2005-09-05 00:06:19 -07:00
Kconfig.debug [PATCH] clean up default value of SYSCALL_DEBUG 2006-06-23 07:43:03 -07:00
Kconfig.i386 [PATCH] uml: skas0 support for 2G/2G hosts 2006-05-01 18:17:43 -07:00
Kconfig.net [PATCH] uml: Rename Kconfig files to be like the other arches 2005-09-05 00:06:19 -07:00
Kconfig.scsi [PATCH] uml: Rename Kconfig files to be like the other arches 2005-09-05 00:06:19 -07:00
Kconfig.x86_64 [PATCH] um: fix undefined reference to hweight32 2006-03-26 08:57:09 -08:00
Makefile [PATCH] uml: uml-makefile-nicer uses SYMLINK incorrectly 2006-05-01 18:17:45 -07:00
Makefile-i386 [PATCH] uml: add -ffreestanding to CFLAGS 2006-06-05 12:29:17 -07:00
Makefile-ia64 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile-os-Linux Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile-ppc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile-skas [PATCH] uml makefiles sanitized 2005-09-29 08:46:26 -07:00
Makefile-tt Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile-x86_64 [PATCH] uml: fix biarch gcc build on x86_64 2006-06-30 11:25:38 -07:00