Skip to content

Commit 964ce50

Browse files
Stefan Haberlandaxboe
authored andcommitted
Revert "s390/dasd: Add discard support for ESE volumes"
This reverts commit 7e64db1. The thin provisioning feature introduces an IOCTL and the discard support to allow userspace tools and filesystems to release unused and previously allocated space respectively. During some internal performance improvements and further tests, the release of allocated space revealed some issues that may lead to data corruption in some configurations when filesystems are mounted with discard support enabled. While we're working on a fix and trying to clarify the situation, this commit reverts the discard support for ESE volumes to prevent potential data corruption. Cc: <[email protected]> # 5.3 Signed-off-by: Stefan Haberland <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent dd45483 commit 964ce50

File tree

1 file changed

+3
-54
lines changed

1 file changed

+3
-54
lines changed

drivers/s390/block/dasd_eckd.c

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,9 +2055,6 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
20552055
if (readonly)
20562056
set_bit(DASD_FLAG_DEVICE_RO, &device->flags);
20572057

2058-
if (dasd_eckd_is_ese(device))
2059-
dasd_set_feature(device->cdev, DASD_FEATURE_DISCARD, 1);
2060-
20612058
dev_info(&device->cdev->dev, "New DASD %04X/%02X (CU %04X/%02X) "
20622059
"with %d cylinders, %d heads, %d sectors%s\n",
20632060
private->rdc_data.dev_type,
@@ -3691,14 +3688,6 @@ static int dasd_eckd_release_space(struct dasd_device *device,
36913688
return -EINVAL;
36923689
}
36933690

3694-
static struct dasd_ccw_req *
3695-
dasd_eckd_build_cp_discard(struct dasd_device *device, struct dasd_block *block,
3696-
struct request *req, sector_t first_trk,
3697-
sector_t last_trk)
3698-
{
3699-
return dasd_eckd_dso_ras(device, block, req, first_trk, last_trk, 1);
3700-
}
3701-
37023691
static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_single(
37033692
struct dasd_device *startdev,
37043693
struct dasd_block *block,
@@ -4443,10 +4432,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
44434432
cmdwtd = private->features.feature[12] & 0x40;
44444433
use_prefix = private->features.feature[8] & 0x01;
44454434

4446-
if (req_op(req) == REQ_OP_DISCARD)
4447-
return dasd_eckd_build_cp_discard(startdev, block, req,
4448-
first_trk, last_trk);
4449-
44504435
cqr = NULL;
44514436
if (cdlspecial || dasd_page_cache) {
44524437
/* do nothing, just fall through to the cmd mode single case */
@@ -4725,14 +4710,12 @@ static struct dasd_ccw_req *dasd_eckd_build_alias_cp(struct dasd_device *base,
47254710
struct dasd_block *block,
47264711
struct request *req)
47274712
{
4728-
struct dasd_device *startdev = NULL;
47294713
struct dasd_eckd_private *private;
4730-
struct dasd_ccw_req *cqr;
4714+
struct dasd_device *startdev;
47314715
unsigned long flags;
4716+
struct dasd_ccw_req *cqr;
47324717

4733-
/* Discard requests can only be processed on base devices */
4734-
if (req_op(req) != REQ_OP_DISCARD)
4735-
startdev = dasd_alias_get_start_dev(base);
4718+
startdev = dasd_alias_get_start_dev(base);
47364719
if (!startdev)
47374720
startdev = base;
47384721
private = startdev->private;
@@ -6513,20 +6496,8 @@ static void dasd_eckd_setup_blk_queue(struct dasd_block *block)
65136496
unsigned int logical_block_size = block->bp_block;
65146497
struct request_queue *q = block->request_queue;
65156498
struct dasd_device *device = block->base;
6516-
struct dasd_eckd_private *private;
6517-
unsigned int max_discard_sectors;
6518-
unsigned int max_bytes;
6519-
unsigned int ext_bytes; /* Extent Size in Bytes */
6520-
int recs_per_trk;
6521-
int trks_per_cyl;
6522-
int ext_limit;
6523-
int ext_size; /* Extent Size in Cylinders */
65246499
int max;
65256500

6526-
private = device->private;
6527-
trks_per_cyl = private->rdc_data.trk_per_cyl;
6528-
recs_per_trk = recs_per_track(&private->rdc_data, 0, logical_block_size);
6529-
65306501
if (device->features & DASD_FEATURE_USERAW) {
65316502
/*
65326503
* the max_blocks value for raw_track access is 256
@@ -6547,28 +6518,6 @@ static void dasd_eckd_setup_blk_queue(struct dasd_block *block)
65476518
/* With page sized segments each segment can be translated into one idaw/tidaw */
65486519
blk_queue_max_segment_size(q, PAGE_SIZE);
65496520
blk_queue_segment_boundary(q, PAGE_SIZE - 1);
6550-
6551-
if (dasd_eckd_is_ese(device)) {
6552-
/*
6553-
* Depending on the extent size, up to UINT_MAX bytes can be
6554-
* accepted. However, neither DASD_ECKD_RAS_EXTS_MAX nor the
6555-
* device limits should be exceeded.
6556-
*/
6557-
ext_size = dasd_eckd_ext_size(device);
6558-
ext_limit = min(private->real_cyl / ext_size, DASD_ECKD_RAS_EXTS_MAX);
6559-
ext_bytes = ext_size * trks_per_cyl * recs_per_trk *
6560-
logical_block_size;
6561-
max_bytes = UINT_MAX - (UINT_MAX % ext_bytes);
6562-
if (max_bytes / ext_bytes > ext_limit)
6563-
max_bytes = ext_bytes * ext_limit;
6564-
6565-
max_discard_sectors = max_bytes / 512;
6566-
6567-
blk_queue_max_discard_sectors(q, max_discard_sectors);
6568-
blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
6569-
q->limits.discard_granularity = ext_bytes;
6570-
q->limits.discard_alignment = ext_bytes;
6571-
}
65726521
}
65736522

65746523
static struct ccw_driver dasd_eckd_driver = {

0 commit comments

Comments
 (0)