mirror of https://gitee.com/openkylin/linux.git
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: [S390] cio: fix potential overflow in chpid descriptor [S390] add missing device put [S390] dasd: use correct label location for diag fba disks
This commit is contained in:
commit
2decd5a7ce
|
@ -948,8 +948,10 @@ static ssize_t dasd_alias_show(struct device *dev,
|
||||||
if (device->discipline && device->discipline->get_uid &&
|
if (device->discipline && device->discipline->get_uid &&
|
||||||
!device->discipline->get_uid(device, &uid)) {
|
!device->discipline->get_uid(device, &uid)) {
|
||||||
if (uid.type == UA_BASE_PAV_ALIAS ||
|
if (uid.type == UA_BASE_PAV_ALIAS ||
|
||||||
uid.type == UA_HYPER_PAV_ALIAS)
|
uid.type == UA_HYPER_PAV_ALIAS) {
|
||||||
|
dasd_put_device(device);
|
||||||
return sprintf(buf, "1\n");
|
return sprintf(buf, "1\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dasd_put_device(device);
|
dasd_put_device(device);
|
||||||
|
|
||||||
|
|
|
@ -713,7 +713,7 @@ int chsc_determine_base_channel_path_desc(struct chp_id chpid,
|
||||||
ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp);
|
ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
memcpy(desc, &chsc_resp->data, chsc_resp->length);
|
memcpy(desc, &chsc_resp->data, sizeof(*desc));
|
||||||
out_free:
|
out_free:
|
||||||
kfree(chsc_resp);
|
kfree(chsc_resp);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -74,6 +74,7 @@ int ibm_partition(struct parsed_partitions *state)
|
||||||
} *label;
|
} *label;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
Sector sect;
|
Sector sect;
|
||||||
|
sector_t labelsect;
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
blocksize = bdev_logical_block_size(bdev);
|
blocksize = bdev_logical_block_size(bdev);
|
||||||
|
@ -97,11 +98,20 @@ int ibm_partition(struct parsed_partitions *state)
|
||||||
ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
|
ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
|
||||||
goto out_freeall;
|
goto out_freeall;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Special case for FBA disks: label sector does not depend on
|
||||||
|
* blocksize.
|
||||||
|
*/
|
||||||
|
if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) ||
|
||||||
|
(info->cu_type == 0x3880 && info->dev_type == 0x3370))
|
||||||
|
labelsect = info->label_block;
|
||||||
|
else
|
||||||
|
labelsect = info->label_block * (blocksize >> 9);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get volume label, extract name and type.
|
* Get volume label, extract name and type.
|
||||||
*/
|
*/
|
||||||
data = read_part_sector(state, info->label_block*(blocksize/512),
|
data = read_part_sector(state, labelsect, §);
|
||||||
§);
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
goto out_readerr;
|
goto out_readerr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue