Skip to content

Commit de7c61d

Browse files
author
Tobias Huschle
committed
s390/dasd: fix no record found for raw_track_access
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2161269 Upstream status: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Tested: by IBM Build-Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=50102305 Conflicts: N commit 590ce6d Author: Stefan Haberland <sth@linux.ibm.com> Date: Wed Nov 23 17:07:18 2022 +0100 s390/dasd: fix no record found for raw_track_access For DASD devices in raw_track_access mode only full track images are read and written. For this purpose it is not necessary to do search operation in the locate record extended function. The documentation even states that this might fail if the searched record is not found on a track. Currently the driver sets a value of 1 in the search field for the first record after record zero. This is the default for disks not in raw_track_access mode but record 1 might be missing on a completely empty track. There has not been any problem with this on IBM storage servers but it might lead to errors with DASD devices on other vendors storage servers. Fix this by setting the search field to 0. Record zero is always available even on a completely empty track. Fixes: e4dbb0f ("[S390] dasd: Add support for raw ECKD access.") Signed-off-by: Stefan Haberland <sth@linux.ibm.com> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com> Link: https://lore.kernel.org/r/20221123160719.3002694-4-sth@linux.ibm.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tobias Huschle <thuschle@redhat.com>
1 parent a70d62a commit de7c61d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/s390/block/dasd_eckd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4725,7 +4725,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
47254725
struct dasd_device *basedev;
47264726
struct req_iterator iter;
47274727
struct dasd_ccw_req *cqr;
4728-
unsigned int first_offs;
47294728
unsigned int trkcount;
47304729
unsigned long *idaws;
47314730
unsigned int size;
@@ -4759,7 +4758,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
47594758
last_trk = (blk_rq_pos(req) + blk_rq_sectors(req) - 1) /
47604759
DASD_RAW_SECTORS_PER_TRACK;
47614760
trkcount = last_trk - first_trk + 1;
4762-
first_offs = 0;
47634761

47644762
if (rq_data_dir(req) == READ)
47654763
cmd = DASD_ECKD_CCW_READ_TRACK;
@@ -4803,13 +4801,13 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
48034801

48044802
if (use_prefix) {
48054803
prefix_LRE(ccw++, data, first_trk, last_trk, cmd, basedev,
4806-
startdev, 1, first_offs + 1, trkcount, 0, 0);
4804+
startdev, 1, 0, trkcount, 0, 0);
48074805
} else {
48084806
define_extent(ccw++, data, first_trk, last_trk, cmd, basedev, 0);
48094807
ccw[-1].flags |= CCW_FLAG_CC;
48104808

48114809
data += sizeof(struct DE_eckd_data);
4812-
locate_record_ext(ccw++, data, first_trk, first_offs + 1,
4810+
locate_record_ext(ccw++, data, first_trk, 0,
48134811
trkcount, cmd, basedev, 0, 0);
48144812
}
48154813

0 commit comments

Comments
 (0)