[PATCH] bcache-tools: bcache-export-cached doesn't match backing device w/ offset, features

From
Marc Smith <hidden>
Date
2021-05-11 19:06:29
updated the awk snippet used in 'bcache-export-cached' so it matches the three
current superblock versions of a "backing" device (BCACHE_SB_VERSION_BDEV,
BCACHE_SB_VERSION_BDEV_WITH_OFFSET, BCACHE_SB_VERSION_BDEV_WITH_FEATURES)

Signed-off-by: Marc A. Smith <redacted>
---
 bcache-export-cached | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bcache-export-cached b/bcache-export-cached
index b345922..e6c1bc3 100644
--- a/bcache-export-cached
+++ b/bcache-export-cached
@@ -19,7 +19,7 @@ for slave in "/sys/class/block/$DEVNAME/slaves"/*; do
             $1 == "dev.uuid" { uuid=$2; }
             $1 == "dev.label" && $2 != "(empty)" { label=$2; }
             END {
-                if (sbver == 1 && uuid) {
+                if ((sbver == 1 || sbver == 4 || sbver == 6) && uuid) {
                     print("CACHED_UUID=" uuid)
                     if (label) print("CACHED_LABEL=" label)
                     exit(0)
-- 
2.20.1
Thread (2 messages) 2 messages, 2 authors, last reply 2021-06-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help