diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-19 22:25:09 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-15 19:39:11 +0200 |
commit | 434e81d174aecaebd3be54dfaa84947bc4a74a57 (patch) | |
tree | 980ddcc1bc26a612c524f3a5d6c9abbe647722ec | |
parent | 130799546b715ff2af6714abe8323bbf89503499 (diff) | |
download | systemd-434e81d174aecaebd3be54dfaa84947bc4a74a57.tar.gz |
repart: handle DISCARD failing with EBUSY gracefully
(cherry picked from commit 22163eb51b682afe969f9381d56315dade874ec1)
(cherry picked from commit da72383bf769e83af7ba94d51dad8ac62b5754eb)
-rw-r--r-- | src/partition/repart.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c index 37fd7dcc2e..89a9574578 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -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; |