|
|
7fd79c |
From ac501e86dd95baa6f426cdd1395f2fe2a9c4e92a Mon Sep 17 00:00:00 2001
|
|
|
7fd79c |
From: Steven Lang <Steven.Lang@hgst.com>
|
|
|
7fd79c |
Date: Thu, 8 Jan 2015 17:22:02 -0800
|
|
|
7fd79c |
Subject: [PATCH 33/36] Use disk geometry as basis for ext2 sector sizes.
|
|
|
7fd79c |
|
|
|
7fd79c |
When creating the geom for probed ext2 based filesystems, the
|
|
|
7fd79c |
size was being reported in 512 byte sectors, regardless of what
|
|
|
7fd79c |
the actual sector size of the device is.
|
|
|
7fd79c |
|
|
|
7fd79c |
(cherry picked from commit d15a596a4436a08b9ad9db35729740b6314d536b)
|
|
|
7fd79c |
---
|
|
|
7fd79c |
libparted/fs/ext2/interface.c | 2 +-
|
|
|
7fd79c |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
7fd79c |
|
|
|
7fd79c |
diff --git a/libparted/fs/ext2/interface.c b/libparted/fs/ext2/interface.c
|
|
|
7fd79c |
index 890a47b..a90c592 100644
|
|
|
7fd79c |
--- a/libparted/fs/ext2/interface.c
|
|
|
7fd79c |
+++ b/libparted/fs/ext2/interface.c
|
|
|
7fd79c |
@@ -41,7 +41,7 @@ _ext2_generic_probe (PedGeometry* geom, int expect_ext_ver)
|
|
|
7fd79c |
struct ext2_super_block *sb = (struct ext2_super_block *)(sb_v + 1024);
|
|
|
7fd79c |
|
|
|
7fd79c |
if (EXT2_SUPER_MAGIC(*sb) == EXT2_SUPER_MAGIC_CONST) {
|
|
|
7fd79c |
- PedSector block_size = 1 << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb) + 1);
|
|
|
7fd79c |
+ PedSector block_size = (EXT2_MIN_BLOCK_SIZE << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb))) / geom->dev->sector_size;
|
|
|
7fd79c |
PedSector block_count = EXT2_SUPER_BLOCKS_COUNT(*sb);
|
|
|
7fd79c |
PedSector group_blocks = EXT2_SUPER_BLOCKS_PER_GROUP(*sb);
|
|
|
7fd79c |
PedSector group_nr = EXT2_SUPER_BLOCK_GROUP_NR(*sb);
|
|
|
7fd79c |
--
|
|
|
7fd79c |
2.5.5
|
|
|
7fd79c |
|