Skip to content

Commit 691da31

Browse files
committed
ext4_utils: Yet another MMC discard pain in the ass
* Secure discard on this device is painfully slow. Use regular discard until the issue is sorted out. Change-Id: Id6cc80ea7a25410b812803425a4b6267289834fb
1 parent 397d03c commit 691da31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext4_utils/wipe.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ int wipe_block_device(int fd, s64 len)
3636
u64 range[2];
3737
int ret;
3838

39+
#ifndef NO_SECURE_DISCARD
3940
range[0] = 0;
4041
range[1] = len;
4142
ret = ioctl(fd, BLKSECDISCARD, &range);
4243
if (ret < 0) {
44+
#endif
4345
range[0] = 0;
4446
range[1] = len;
4547
ret = ioctl(fd, BLKDISCARD, &range);
@@ -50,8 +52,9 @@ int wipe_block_device(int fd, s64 len)
5052
warn("Wipe via secure discard failed, used discard instead\n");
5153
return 0;
5254
}
55+
#ifndef NO_SECURE_DISCARD
5356
}
54-
57+
#endif
5558
return 0;
5659
}
5760
#else

0 commit comments

Comments
 (0)