repart: wipe partition first, then discard
authorLennart Poettering <lennart@poettering.net>
Thu, 30 Jul 2020 20:22:21 +0000 (22:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Aug 2020 20:00:31 +0000 (22:00 +0200)
commitf0cb1b951caeec68d4c892c7d02e6829f6f95a48
tree7ccf985b6596ecc3a23357e1bd86d82b266109bf
parent5b5109e2252cdf184aeecf10fac34234084eef32
repart: wipe partition first, then discard

Wiping means writing zero sectors to disk. Hence it's better to do this
before we discard, so that the zeroes we use to overwrite are properly
discarded. If we'd do it the other way round we'd discard the data and
then reallocte it just to write zeroes.
src/partition/repart.c