Commit 151fd0f
committed
btrfs: accept btrfs.size from storage.conf and apply default on RW layers
storage.conf documents [storage.options.btrfs] size, and pkg/config already
emits btrfs.size=... for the graph driver. The btrfs driver parseOptions
only handled min_space and rejected size, so storage init failed with an
unknown option error.
Parse size like min_space (RAMInBytes, enable quota when set). For
read-write layers, if there is no explicit storage-opt size, apply the
configured default inside create() without mutating the caller's
StorageOpt map and without formatting the default to a string only to
parse it again.
Add a small unit test for parseOptions.
Fixes: #718
Signed-off-by: Akhil Ammu <akhil.ammu@aiven.io>1 parent 8af7873 commit 151fd0f
2 files changed
Lines changed: 46 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
117 | 124 | | |
118 | 125 | | |
119 | 126 | | |
| |||
476 | 483 | | |
477 | 484 | | |
478 | 485 | | |
479 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
480 | 492 | | |
481 | 493 | | |
482 | 494 | | |
483 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
484 | 500 | | |
485 | 501 | | |
486 | 502 | | |
| |||
512 | 528 | | |
513 | 529 | | |
514 | 530 | | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
519 | 541 | | |
520 | | - | |
521 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
522 | 550 | | |
523 | 551 | | |
524 | 552 | | |
525 | 553 | | |
526 | 554 | | |
527 | | - | |
| 555 | + | |
528 | 556 | | |
529 | 557 | | |
530 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
| |||
0 commit comments