]> git.baikalelectronics.ru Git - kernel.git/commit
block: improve automatic native capacity unlocking
authorTejun Heo <tj@kernel.org>
Sat, 15 May 2010 18:09:31 +0000 (20:09 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 21 May 2010 18:01:03 +0000 (20:01 +0200)
commitadc1e5648bb359f1a8b2a59c20257cdfa7018535
treeb6672b43cc1808632547f2f16c917d33d85e1399
parent0490d3f69770ac65d8c5e0c0ff3b97feadd3a758
block: improve automatic native capacity unlocking

Currently, native capacity unlocking is initiated only when a
recognized partition extends beyond the end of the disk.  However,
there are several other unhandled cases where truncated capacity can
lead to misdetection of partitions.

* Partition table is fully beyond EOD.

* Partition table is partially beyond EOD (daisy chained ones).

* Recognized partition starts beyond EOD.

This patch updates generic partition check code such that all the
above three cases are handled too.  For the first two, @state tracks
whether low level partition check code tried to read beyond EOD during
partition scan and triggers native capacity unlocking accordingly.
The third is now handled similarly to the original unlocking case.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/partitions/check.c
fs/partitions/check.h