Skip to content

Commit

Permalink
[PATCH] s390: don't pad cdl blocks for write requests
Browse files Browse the repository at this point in the history
The first blocks on a cdl formatted dasd device are smaller than the blocksize
of the device.  Read requests are padded with a 'e5' pattern.  Write requests
should not pad the (user) buffer with 'e5' because a write request is not
allowed to modify the buffer.

Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
HorstHummel authored and Linus Torvalds committed May 1, 2005
1 parent 6ed93c8 commit ec5883a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/s390/block/dasd_eckd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Bugreports.to..: <[email protected]>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
*
* $Revision: 1.69 $
* $Revision: 1.71 $
*/

#include <linux/config.h>
Expand Down Expand Up @@ -1101,7 +1101,8 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
if (dasd_eckd_cdl_special(blk_per_trk, recid)){
rcmd |= 0x8;
count = dasd_eckd_cdl_reclen(recid);
if (count < blksize)
if (count < blksize &&
rq_data_dir(req) == READ)
memset(dst + count, 0xe5,
blksize - count);
}
Expand Down

0 comments on commit ec5883a

Please sign in to comment.