1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-08 05:57:26 +03:00

repart: handle DISCARD failing with EBUSY gracefully

(cherry picked from commit 22163eb51b682afe969f9381d56315dade874ec1)
(cherry picked from commit da72383bf769e83af7ba94d51dad8ac62b5754eb)
This commit is contained in:
Lennart Poettering 2021-03-19 22:25:09 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 130799546b
commit 434e81d174

View File

@ -2251,6 +2251,11 @@ static int context_discard_partition(Context *context, Partition *p) {
log_info("Storage does not support discard, not discarding data in future partition %" PRIu64 ".", p->partno);
return 0;
}
if (r == -EBUSY) {
/* Let's handle this gracefully: https://bugzilla.kernel.org/show_bug.cgi?id=211167 */
log_info("Block device is busy, not discarding partition %" PRIu64 " because it probably is mounted.", p->partno);
return 0;
}
if (r == 0) {
log_info("Partition %" PRIu64 " too short for discard, skipping.", p->partno);
return 0;