diff options
author | Tejun Heo <tj@kernel.org> | 2008-08-25 06:47:25 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:06 -0400 |
commit | 870d6656126add8e383645732b03df2b7ccd4f94 (patch) | |
tree | 9c33dd91350ea163b160d9f5cb40d913c5caf268 /drivers/ide | |
parent | f615b48cc7df7cac3865ec76ac1a5bb04d3e07f4 (diff) |
block: implement CONFIG_DEBUG_BLOCK_EXT_DEVT
Extended devt introduces non-contiguos device numbers. This patch
implements a debug option which forces most devt allocations to be
from the extended area and spreads them out. This is enabled by
default if DEBUG_KERNEL is set and achieves...
1. Detects code paths in kernel or userland which expect predetermined
consecutive device numbers.
2. When something goes wrong, avoid corruption as adding to the minor
of earlier partition won't lead to the wrong but valid device.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-disk.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 7a88de9ada29..a072df5053ae 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -42,7 +42,13 @@ | |||
42 | #include <asm/div64.h> | 42 | #include <asm/div64.h> |
43 | 43 | ||
44 | #define IDE_DISK_PARTS (1 << PARTN_BITS) | 44 | #define IDE_DISK_PARTS (1 << PARTN_BITS) |
45 | |||
46 | #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) | ||
45 | #define IDE_DISK_MINORS IDE_DISK_PARTS | 47 | #define IDE_DISK_MINORS IDE_DISK_PARTS |
48 | #else | ||
49 | #define IDE_DISK_MINORS 1 | ||
50 | #endif | ||
51 | |||
46 | #define IDE_DISK_EXT_MINORS (IDE_DISK_PARTS - IDE_DISK_MINORS) | 52 | #define IDE_DISK_EXT_MINORS (IDE_DISK_PARTS - IDE_DISK_MINORS) |
47 | 53 | ||
48 | struct ide_disk_obj { | 54 | struct ide_disk_obj { |