Skip to content

Commit 7557c1b

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Four small fixes. Three are in drivers for fairly obvious bugs. The fourth is a set of regressions introduced by the compat_ioctl changes because some of the compat updates wrongly replaced .ioctl instead of .compat_ioctl" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: compat_ioctl: cdrom: Replace .ioctl with .compat_ioctl in four appropriate places scsi: zfcp: fix wrong data and display format of SFP+ temperature scsi: sd_sbc: Fix sd_zbc_report_zones() scsi: libfc: free response frame from GPN_ID
2 parents 29795de + 03264dd commit 7557c1b

File tree

8 files changed

+14
-7
lines changed

8 files changed

+14
-7
lines changed

drivers/block/paride/pcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static const struct block_device_operations pcd_bdops = {
276276
.release = pcd_block_release,
277277
.ioctl = pcd_block_ioctl,
278278
#ifdef CONFIG_COMPAT
279-
.ioctl = blkdev_compat_ptr_ioctl,
279+
.compat_ioctl = blkdev_compat_ptr_ioctl,
280280
#endif
281281
.check_events = pcd_block_check_events,
282282
};

drivers/cdrom/gdrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ static const struct block_device_operations gdrom_bdops = {
519519
.check_events = gdrom_bdops_check_events,
520520
.ioctl = gdrom_bdops_ioctl,
521521
#ifdef CONFIG_COMPAT
522-
.ioctl = blkdev_compat_ptr_ioctl,
522+
.compat_ioctl = blkdev_compat_ptr_ioctl,
523523
#endif
524524
};
525525

drivers/ide/ide-gd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static const struct block_device_operations ide_gd_ops = {
361361
.release = ide_gd_release,
362362
.ioctl = ide_gd_ioctl,
363363
#ifdef CONFIG_COMPAT
364-
.ioctl = ide_gd_compat_ioctl,
364+
.compat_ioctl = ide_gd_compat_ioctl,
365365
#endif
366366
.getgeo = ide_gd_getgeo,
367367
.check_events = ide_gd_check_events,

drivers/s390/scsi/zfcp_fsf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ struct fsf_qtcb_bottom_port {
410410
u8 cb_util;
411411
u8 a_util;
412412
u8 res2;
413-
u16 temperature;
413+
s16 temperature;
414414
u16 vcc;
415415
u16 tx_bias;
416416
u16 tx_power;

drivers/s390/scsi/zfcp_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ static ZFCP_DEV_ATTR(adapter_diag, b2b_credit, 0400,
800800
static ZFCP_DEV_ATTR(adapter_diag_sfp, _name, 0400, \
801801
zfcp_sysfs_adapter_diag_sfp_##_name##_show, NULL)
802802

803-
ZFCP_DEFINE_DIAG_SFP_ATTR(temperature, temperature, 5, "%hu");
803+
ZFCP_DEFINE_DIAG_SFP_ATTR(temperature, temperature, 6, "%hd");
804804
ZFCP_DEFINE_DIAG_SFP_ATTR(vcc, vcc, 5, "%hu");
805805
ZFCP_DEFINE_DIAG_SFP_ATTR(tx_bias, tx_bias, 5, "%hu");
806806
ZFCP_DEFINE_DIAG_SFP_ATTR(tx_power, tx_power, 5, "%hu");

drivers/scsi/libfc/fc_disc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
628628
}
629629
out:
630630
kref_put(&rdata->kref, fc_rport_destroy);
631+
if (!IS_ERR(fp))
632+
fc_frame_free(fp);
631633
}
632634

633635
/**

drivers/scsi/sd_zbc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,
161161
unsigned int nr_zones, report_zones_cb cb, void *data)
162162
{
163163
struct scsi_disk *sdkp = scsi_disk(disk);
164+
sector_t capacity = logical_to_sectors(sdkp->device, sdkp->capacity);
164165
unsigned int nr, i;
165166
unsigned char *buf;
166167
size_t offset, buflen = 0;
@@ -171,11 +172,15 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,
171172
/* Not a zoned device */
172173
return -EOPNOTSUPP;
173174

175+
if (!capacity)
176+
/* Device gone or invalid */
177+
return -ENODEV;
178+
174179
buf = sd_zbc_alloc_report_buffer(sdkp, nr_zones, &buflen);
175180
if (!buf)
176181
return -ENOMEM;
177182

178-
while (zone_idx < nr_zones && sector < get_capacity(disk)) {
183+
while (zone_idx < nr_zones && sector < capacity) {
179184
ret = sd_zbc_do_report_zones(sdkp, buf, buflen,
180185
sectors_to_logical(sdkp->device, sector), true);
181186
if (ret)

drivers/scsi/sr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ static const struct block_device_operations sr_bdops =
688688
.release = sr_block_release,
689689
.ioctl = sr_block_ioctl,
690690
#ifdef CONFIG_COMPAT
691-
.ioctl = sr_block_compat_ioctl,
691+
.compat_ioctl = sr_block_compat_ioctl,
692692
#endif
693693
.check_events = sr_block_check_events,
694694
.revalidate_disk = sr_block_revalidate_disk,

0 commit comments

Comments
 (0)