Skip to content

Commit 5bcd951

Browse files
hyperb1issSteve Kondik
authored and
Steve Kondik
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: Ib8ccb12829385aa267253f772e243bef8850f455
1 parent aa3f820 commit 5bcd951

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
@@ -42,10 +42,12 @@ int wipe_block_device(int fd, s64 len)
4242
return 0;
4343
}
4444

45+
#ifndef NO_SECURE_DISCARD
4546
range[0] = 0;
4647
range[1] = len;
4748
ret = ioctl(fd, BLKSECDISCARD, &range);
4849
if (ret < 0) {
50+
#endif
4951
range[0] = 0;
5052
range[1] = len;
5153
ret = ioctl(fd, BLKDISCARD, &range);
@@ -56,8 +58,9 @@ int wipe_block_device(int fd, s64 len)
5658
warn("Wipe via secure discard failed, used discard instead\n");
5759
return 0;
5860
}
61+
#ifndef NO_SECURE_DISCARD
5962
}
60-
63+
#endif
6164
return 0;
6265
}
6366

0 commit comments

Comments
 (0)