summaryrefslogtreecommitdiff
path: root/drivers/scsi/sr_ioctl.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2020-12-04 19:48:49 +0300
committerJens Axboe <axboe@kernel.dk>2020-12-12 21:12:25 +0300
commit8d2ac857a81d5a44b9643038291ea958bbf05c7f (patch)
tree6149c1b1da2577dbafdb5c36ea214efc1d55b07d /drivers/scsi/sr_ioctl.c
parentb5f32555567cfe0a5d5dbe7c1e85ebe37b3f545a (diff)
downloadlinux-8d2ac857a81d5a44b9643038291ea958bbf05c7f.tar.xz
sr: Switch the sector size back to 2048 if sr_read_sector() changed it.
sr_read_sector() is hardly used since v2.3.16. Its only purpose is to check if it is a XA medium via sr_is_xa(). This check is only enabled if the module parameter `xa_test' is enabled. Change the sector size back to 2048 if it was changed. With this change, there is no lazy sector size changing left. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/sr_ioctl.c')
-rw-r--r--drivers/scsi/sr_ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index ffcf902da390..5703f8400b73 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -549,6 +549,8 @@ static int sr_read_sector(Scsi_CD *cd, int lba, int blksize, unsigned char *dest
cgc.timeout = IOCTL_TIMEOUT;
rc = sr_do_ioctl(cd, &cgc);
+ if (blksize != CD_FRAMESIZE)
+ rc |= sr_set_blocklength(cd, CD_FRAMESIZE);
return rc;
}