~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/s390/dasd-use-correct-label-location-for-diag-fba-disks.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
6
 
commit cffab6bc5511cd6f67a60bf16b62de4267b68c4c upstream.
7
 
 
8
 
Partition boundary calculation fails for DASD FBA disks under the
9
 
following conditions:
10
 
- disk is formatted with CMS FORMAT with a blocksize of more than
11
 
  512 bytes
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
14
 
 
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
18
 
block offset 1.
19
 
 
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
22
 
information.
23
 
 
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]
27
 
---
28
 
 fs/partitions/ibm.c |   13 ++++++++++++-
29
 
 1 files changed, 12 insertions(+), 1 deletions(-)
30
 
 
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)
36
 
        } *label;
37
 
        unsigned char *data;
38
 
        Sector sect;
39
 
+       sector_t labelsect;
40
 
 
41
 
        res = 0;
42
 
        blocksize = bdev_logical_block_size(bdev);
43
 
@@ -98,9 +99,19 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
44
 
                goto out_freeall;
45
 
 
46
 
        /*
47
 
+        * Special case for FBA disks: label sector does not depend on
48
 
+        * blocksize.
49
 
+        */
50
 
+       if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) ||
51
 
+           (info->cu_type == 0x3880 && info->dev_type == 0x3370))
52
 
+               labelsect = info->label_block;
53
 
+       else
54
 
+               labelsect = info->label_block * (blocksize >> 9);
55
 
+
56
 
+       /*
57
 
         * Get volume label, extract name and type.
58
 
         */
59
 
-       data = read_dev_sector(bdev, info->label_block*(blocksize/512), &sect);
60
 
+       data = read_dev_sector(bdev, labelsect, &sect);
61
 
        if (data == NULL)
62
 
                goto out_readerr;
63
 
 
64
 
1.7.1
65