2002-10-09 14:31:56

by Cameron, Steve

[permalink] [raw]
Subject: [PATCH] 2.5.41, cciss, fix cciss_open (2 of 5)



This patch fixes a problem with detecting partitions on any but
the first disk. Detecting the partitions requires opening the device,
but the i_size test prevented this, except for the special case of c0d0.
The new test corrects this, allow partition tables to be read for all the
disks. Applies to 2.5.40.

diff -urN linux-2.5.40-0/drivers/block/cciss.c linux-2.5.40-cciss-fix-vol/drivers/block/cciss.c
--- linux-2.5.40-0/drivers/block/cciss.c Thu Oct 3 14:25:16 2002
+++ linux-2.5.40-cciss-fix-vol/drivers/block/cciss.c Mon Oct 7 09:09:50 2002
@@ -352,7 +352,7 @@
* but I'm already using way to many device nodes to claim another one
* for "raw controller".
*/
- if (inode->i_bdev->bd_inode->i_size == 0) {
+ if (hba[ctlr]->drv[dsk].nr_blocks == 0) {
if (minor(inode->i_rdev) != 0)
return -ENXIO;
if (!capable(CAP_SYS_ADMIN))