From e351f8bc66d49fecaa0ab78f8413d50a4674604a Mon Sep 17 00:00:00 2001 From: David Teigland Date: Tue, 6 Mar 2018 15:05:27 -0600 Subject: [PATCH] lvmetad: need to set up bcache in another place We need to find one common place to set up bcache for the lvmetad case, instead of adding calls in various places. --- lib/label/label.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/label/label.c b/lib/label/label.c index 82d4bf3ef..9401067a7 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -675,6 +675,13 @@ int label_scan_devs(struct cmd_context *cmd, struct dm_list *devs) { struct device_list *devl; + /* FIXME: get rid of this, it's only needed for lvmetad in which + case we should be setting up bcache in one place. */ + if (!scan_bcache) { + if (!_setup_bcache(0)) + return 0; + } + dm_list_iterate_items(devl, devs) { if (_in_bcache(devl->dev)) { bcache_invalidate_fd(scan_bcache, devl->dev->bcache_fd);