1
From df12aa28eb11ec64887a6a2b834d8fe3f0b68e2c Mon Sep 17 00:00:00 2001
2
From: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
3
Date: Mon, 19 Jul 2010 09:22:35 +0200
4
Subject: [PATCH] [S390] dasd: use correct label location for diag fba disks
6
commit cffab6bc5511cd6f67a60bf16b62de4267b68c4c upstream.
8
Partition boundary calculation fails for DASD FBA disks under the
10
- disk is formatted with CMS FORMAT with a blocksize of more than
12
- all of the disk is reserved to a single CMS file using CMS RESERVE
13
- the disk is accessed using the DIAG mode of the DASD driver
15
Under these circumstances, the partition detection code tries to
16
read the CMS label block containing partition-relevant information
17
from logical block offset 1, while it is in fact located at physical
20
Fix this problem by using the correct CMS label block location
21
depending on the device type as determined by the DASD SENSE ID
24
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
25
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
26
[bwh: Adjust for 2.6.32]
28
fs/partitions/ibm.c | 13 ++++++++++++-
29
1 files changed, 12 insertions(+), 1 deletions(-)
31
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c
32
index fc71aab..bae725b 100644
33
--- a/fs/partitions/ibm.c
34
+++ b/fs/partitions/ibm.c
35
@@ -74,6 +74,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
42
blocksize = bdev_logical_block_size(bdev);
43
@@ -98,9 +99,19 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
47
+ * Special case for FBA disks: label sector does not depend on
50
+ if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) ||
51
+ (info->cu_type == 0x3880 && info->dev_type == 0x3370))
52
+ labelsect = info->label_block;
54
+ labelsect = info->label_block * (blocksize >> 9);
57
* Get volume label, extract name and type.
59
- data = read_dev_sector(bdev, info->label_block*(blocksize/512), §);
60
+ data = read_dev_sector(bdev, labelsect, §);