projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55d3801
)
repart: handle DISCARD failing with EBUSY gracefully
author
Lennart Poettering
<lennart@poettering.net>
Fri, 19 Mar 2021 21:25:09 +0000
(22:25 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 19 Apr 2021 21:16:02 +0000
(23:16 +0200)
src/partition/repart.c
patch
|
blob
|
history
diff --git
a/src/partition/repart.c
b/src/partition/repart.c
index ac6e4e7f862505cd5de68b045ee83372b50ad331..351b3d1b5e959bda44126b62f9ff44b269df6de1 100644
(file)
--- a/
src/partition/repart.c
+++ b/
src/partition/repart.c
@@
-2269,6
+2269,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;