[<prev] [next>] [day] [month] [year] [list]
Message-ID: <B26937397E6007499534B0945FF66E8A552E98@vmsk-exch-01.paragon-software.com>
Date: Thu, 18 Dec 2014 15:51:14 +0000
From: Alexander Kim <Alexander.Kim@...agon-software.com>
To: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"axboe@...nel.dk" <axboe@...nel.dk>
CC: Alexey Adadurov <Alexey.Adadurov@...agon-software.com>
Subject: [PATCH] APM: fix type of secsize in mac.c
Hi all
Our company had been working on a project for a customer and faced the following problem:
One line summary of the problem:
Kernel detects wrong partitions sizes for large volume with APM partition
table.
Full description of the problem/report:
When using 2+ TB volume with APM partition table and one of the partitions
on it (also may be single partition) of size 2+ TB, one can notice that
(for example block device is sdb)
'/sys/block/sdb/size' contains significantly different (with factor greater
than 2) size than the sum of all '/sys/block/sdb/sdb*/size'
The problem is in block/partitions/mac.c source:
in function
int mac_partition(struct parsed_partitions *state)
the declaration of 'secsize' variable is 'unsigned secsize', but should be
'sector_t secsize'
Keywords:
APM, kernel, block, mac, sector_t, secsize
All significant environment information you could find in attachments (env.txt). The bug also appears in the latest upstream kernel:
http://lxr.free-electrons.com/source/block/partitions/mac.c#L35
A small shell script or example program which triggers the problem
Bug could be reproduced by two shell commands:
i=0; for f in /sys/block/sdb/sdb*/size; do let i=$i+`cat $f`; done; echo
$i
cat /sys/block/sdb/size
The result is two significantly different numbers.
Simple fix: replace 'unsigned secsize' with 'sector_t secsize' (*.patch in
attachements) in block/partition/mac.c
Download attachment "APM_secsize_type.patch" of type "application/octet-stream" (510 bytes)
View attachment "env.txt" of type "text/plain" (77632 bytes)
Powered by blists - more mailing lists