Skip to content

Commit 590ce6d

Browse files
Stefan Haberlandaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Jan Hoeppner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent b49e648 commit 590ce6d

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
@@ -4722,7 +4722,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
47224722
struct dasd_device *basedev;
47234723
struct req_iterator iter;
47244724
struct dasd_ccw_req *cqr;
4725-
unsigned int first_offs;
47264725
unsigned int trkcount;
47274726
unsigned long *idaws;
47284727
unsigned int size;
@@ -4756,7 +4755,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
47564755
last_trk = (blk_rq_pos(req) + blk_rq_sectors(req) - 1) /
47574756
DASD_RAW_SECTORS_PER_TRACK;
47584757
trkcount = last_trk - first_trk + 1;
4759-
first_offs = 0;
47604758

47614759
if (rq_data_dir(req) == READ)
47624760
cmd = DASD_ECKD_CCW_READ_TRACK;
@@ -4800,13 +4798,13 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
48004798

48014799
if (use_prefix) {
48024800
prefix_LRE(ccw++, data, first_trk, last_trk, cmd, basedev,
4803-
startdev, 1, first_offs + 1, trkcount, 0, 0);
4801+
startdev, 1, 0, trkcount, 0, 0);
48044802
} else {
48054803
define_extent(ccw++, data, first_trk, last_trk, cmd, basedev, 0);
48064804
ccw[-1].flags |= CCW_FLAG_CC;
48074805

48084806
data += sizeof(struct DE_eckd_data);
4809-
locate_record_ext(ccw++, data, first_trk, first_offs + 1,
4807+
locate_record_ext(ccw++, data, first_trk, 0,
48104808
trkcount, cmd, basedev, 0, 0);
48114809
}
48124810

0 commit comments

Comments
 (0)