Skip to contentSkip to conversation

s390: don't pad cdl blocks for write requests.

PATCH In review Martin Schwidefsky 1 participant 1 message Apr 22, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 9/12 s390: don't pad cdl blocks for write requests.

[patch 9/12] s390: don't pad cdl blocks for write requests.

From: Horst Hummel <[email protected]>

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.

diffstat:

 drivers/s390/block/dasd_eckd.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/s390/block/dasd_eckd.c +3 -2
diff -urpN linux-2.6/drivers/s390/block/dasd_eckd.c linux-2.6-patched/drivers/s390/block/dasd_eckd.c
@@ -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>
@@ -1101,7 +1101,8 @@ dasd_eckd_build_cp(struct dasd_device * 
 				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);
 				}