All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volkan Unal <vunal@linux.ibm.com>
To: linux-s390@vger.kernel.org
Cc: oberpar@linux.ibm.com, sth@linux.ibm.com, hoeppner@linux.ibm.com,
	meted@linux.ibm.com
Subject: [PATCH 0/3] s390/dasd: Restrict discard support to virtual DASD devices
Date: Wed, 22 Jul 2026 16:16:48 +0100	[thread overview]
Message-ID: <20260722151651.292621-1-vunal@linux.ibm.com> (raw)

The current implementation enables discard support for all FBA DASD disk
without checking whether device is virtual (memory-backed) or physical disk.

Background:
The discard implementation for FBA DASD was designed to leverage z/VM's
discard behavior for virtual FBA disks (VFBA, CU 6310):

  - VDISK             -> discard causes page release
  - EDEV (SCSI/NVMe)  -> discard causes zero-write
  - Physical FBA Disk -> discard not supported

Discard behavior for Physical FBA should be consistent with ECKD disks.
In particular, discard should remain disabled for Physical FBA, just as
it is for ECKD. This change is not intended to affect the behavior of
virtual FBA disks.

Ex :
Before changeset (where dasdd is physical FBA DASD)
#cat /sys/block/dasdd/queue/discard_max_bytes
33550336

#blkdiscard -f -o 1048576 -l 1048576 /dev/dasdd
blkdiscard: Operation forced, data will be lost!
blkdiscard: BLKDISCARD: /dev/dasdd ioctl failed: Input/output error

#dmesg
[  271.893040] crw_info : CRW reports slct=0, oflw=0, chn=0, rsc=3, anc=1, erc=4, rsid=18
[  567.513852] crw_info : CRW reports slct=0, oflw=0, chn=0, rsc=3, anc=1, erc=4, rsid=19
[  621.254231] ctcm: CTCM driver initialized
[  621.313130] dasd-fba 0.0.9901: New FBA DASD 3370/04 (CU 3880/01) with 20480 MB and 512 B/blk
[  621.314748]  dasdd:(nonl) dasdd1
[  825.958866] 0.0.9901: default ERP has run out of retries and failed
[  825.958882] dasd-fba 0.0.9901: I/O status report:
               in req: 00000000fed88110 CS: 0x00 DS: 0x0E
               Failing CCW: 00000000005a5fe0
               Sense(hex)  0- 7: 80 00 00 00 01 ff ff 03
               Sense(hex)  8-15: 00 00 00 00 00 00 00 04
               Sense(hex) 16-23: e8 68 01 41 ff 99 0f 03
               Sense(hex) 24-31: 00 00 40 e2 00 00 00 00
[  825.958888] dasd-fba 0.0.9901: Related CP in req: 00000000fed88110
               CCW 00000000005a5fc8: 63400010 005A5FE0 DAT: 00000200 00000800 00000000 000007FF
               CCW 00000000005a5fd0: 43400008 005A5FF0 DAT: 05000800 00000000
               CCW 00000000005a5fd8: 41200000 00000000 DAT:
[  825.958894] I/O error, dev dasdd, sector 2048 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 2
[  825.961798]  dasdd:(nonl) dasdd1


After changeset:

#cat /sys/block/dasdc/queue/discard_max_bytes
0

#blkdiscard -f -o 1048576 -l 1048576 /dev/dasdc ((where dasdc is physical FBA DASD))
blkdiscard: Operation forced, data will be lost!
blkdiscard: BLKDISCARD: /dev/dasdc ioctl failed: Operation not supported


Volkan Unal (3):
  s390/dasd: Add device type defines for FBA devices
  s390/dasd: Restrict discard support to virtual DASD devices
  s390/dasd: Make FBA discard support conditional per device

 drivers/s390/block/dasd.c     |  2 +-
 drivers/s390/block/dasd_fba.c | 20 +++++++++++++++-----
 drivers/s390/block/dasd_int.h |  1 -
 3 files changed, 16 insertions(+), 7 deletions(-)

-- 
2.55.0


             reply	other threads:[~2026-07-22 15:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 15:16 Volkan Unal [this message]
2026-07-22 15:16 ` [PATCH 1/3] s390/dasd: Add device type defines for FBA devices Volkan Unal
2026-07-22 15:20   ` sashiko-bot
2026-07-22 15:16 ` [PATCH 2/3] s390/dasd: Restrict discard support to virtual DASD devices Volkan Unal
2026-07-22 15:33   ` sashiko-bot
2026-07-22 15:16 ` [PATCH 3/3] s390/dasd: Make FBA discard support conditional per device Volkan Unal
2026-07-22 15:38   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260722151651.292621-1-vunal@linux.ibm.com \
    --to=vunal@linux.ibm.com \
    --cc=hoeppner@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=meted@linux.ibm.com \
    --cc=oberpar@linux.ibm.com \
    --cc=sth@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.