Compare commits
2 Commits
df752c17e2
...
1ba395a779
Author | SHA1 | Date |
---|---|---|
Daan De Meyer | 1ba395a779 | |
Daan De Meyer | 2cef09e567 |
|
@ -7576,6 +7576,11 @@ static int context_minimize(Context *context) {
|
||||||
if (fstat(fd, &st) < 0)
|
if (fstat(fd, &st) < 0)
|
||||||
return log_error_errno(errno, "Failed to stat temporary file: %m");
|
return log_error_errno(errno, "Failed to stat temporary file: %m");
|
||||||
|
|
||||||
|
if ((uint64_t) st.st_size > partition_max_size(context, p))
|
||||||
|
return log_error_errno(SYNTHETIC_ERRNO(E2BIG),
|
||||||
|
"Minimal partition size of %s filesystem of partition %s exceeds configured maximum size (%s > %s)",
|
||||||
|
p->format, strna(hint), FORMAT_BYTES(st.st_size), FORMAT_BYTES(partition_max_size(context, p)));
|
||||||
|
|
||||||
log_info("Minimal partition size of %s filesystem of partition %s is %s",
|
log_info("Minimal partition size of %s filesystem of partition %s is %s",
|
||||||
p->format, strna(hint), FORMAT_BYTES(st.st_size));
|
p->format, strna(hint), FORMAT_BYTES(st.st_size));
|
||||||
|
|
||||||
|
@ -7612,8 +7617,12 @@ static int context_minimize(Context *context) {
|
||||||
* fool-proof. */
|
* fool-proof. */
|
||||||
uint64_t heuristic = streq(p->format, "xfs") ? fsz : fsz / 2;
|
uint64_t heuristic = streq(p->format, "xfs") ? fsz : fsz / 2;
|
||||||
fsz = round_up_size(fsz + heuristic, context->grain_size);
|
fsz = round_up_size(fsz + heuristic, context->grain_size);
|
||||||
if (minimal_size_by_fs_name(p->format) != UINT64_MAX)
|
fsz = MAX(partition_min_size(context, p), fsz);
|
||||||
fsz = MAX(minimal_size_by_fs_name(p->format), fsz);
|
|
||||||
|
if (fsz > partition_max_size(context, p))
|
||||||
|
return log_error_errno(SYNTHETIC_ERRNO(E2BIG),
|
||||||
|
"Minimal partition size of %s filesystem of partition %s exceeds configured maximum size (%s > %s)",
|
||||||
|
p->format, strna(hint), FORMAT_BYTES(fsz), FORMAT_BYTES(partition_max_size(context, p)));
|
||||||
|
|
||||||
log_info("Minimal partition size of %s filesystem of partition %s is %s",
|
log_info("Minimal partition size of %s filesystem of partition %s is %s",
|
||||||
p->format, strna(hint), FORMAT_BYTES(fsz));
|
p->format, strna(hint), FORMAT_BYTES(fsz));
|
||||||
|
|
Loading…
Reference in New Issue