linux/fs/partitions
Tejun Heo 88e341261c block: update add_partition() error handling
d805dda4 tried to fix error case handling in add_partition() but had a
few problems.

* disk->part[] entry is set early and left dangling if operation
  fails.

* Once device initialized, the last put_device() is responsible for
  freeing all the resources.  The failure path freed part_stats and p
  regardless of put_device() causing double free.

* holders subdir holds reference to the disk device, so failure path
  should remove it to release resources properly which was missing.

This patch fixes the above problems and while at it move partition
slot busy check into add_partition() for completeness and inlines
holders subdirectory creation.  Using separate function for it just
obfuscates the code.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Abdel Benamrouche <draconux@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-10-09 08:56:04 +02:00
..
Kconfig partition: use DEFAULT_SGI_PARTITION for SGI_PARTION default 2008-02-06 10:41:08 -08:00
Makefile
acorn.c
acorn.h
amiga.c
amiga.h
atari.c
atari.h
check.c block: update add_partition() error handling 2008-10-09 08:56:04 +02:00
check.h
efi.c fs/partitions/efi: convert to pr_debug 2008-07-25 10:53:44 -07:00
efi.h
ibm.c
ibm.h
karma.c
karma.h
ldm.c fs: ldm.[ch] use get_unaligned_* helpers 2008-07-25 10:53:26 -07:00
ldm.h fs: ldm.[ch] use get_unaligned_* helpers 2008-07-25 10:53:26 -07:00
mac.c
mac.h
msdos.c fat: detect media without partition table correctly 2008-04-28 08:58:47 -07:00
msdos.h
osf.c
osf.h
sgi.c
sgi.h
sun.c fs/partitions/sun.c endianness annotations 2007-10-14 12:41:51 -07:00
sun.h [PARTITION]: Sun/Solaris VTOC table corrections 2007-07-30 00:27:31 -07:00
sysv68.c
sysv68.h
ultrix.c
ultrix.h