All of lore.kernel.org
 help / color / mirror / Atom feed
* master - scan: create bcache with minimum number of blocks
@ 2018-04-23 13:51 David Teigland
  0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2018-04-23 13:51 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=21057676a1f01c6b1f19b2e879d8385d76adb517
Commit:        21057676a1f01c6b1f19b2e879d8385d76adb517
Parent:        e49b114f7e437666caefa04aada31f32820e286e
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Feb 27 12:35:45 2018 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Apr 20 11:22:47 2018 -0500

scan: create bcache with minimum number of blocks

In some odd cases (e.g. tests) there are very few devices
which results in creating too few blocks in bcache, so
create bcache with a minimum number of blocks.
---
 lib/label/label.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/label/label.c b/lib/label/label.c
index 45a3ecf..88001a9 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -560,13 +560,15 @@ static int _scan_list(struct dm_list *devs, int *failed)
 	return 1;
 }
 
+#define MIN_BCACHE_BLOCKS 32
+
 static int _setup_bcache(int cache_blocks)
 {
 	struct io_engine *ioe;
 
 	/* No devices can happen, just create bcache with any small number. */
-	if (!cache_blocks)
-		cache_blocks = 8;
+	if (cache_blocks < MIN_BCACHE_BLOCKS)
+		cache_blocks = MIN_BCACHE_BLOCKS;
 
 	/*
 	 * 100 is arbitrary, it's the max number of concurrent aio's
@@ -831,7 +833,7 @@ int label_read_sector(struct device *dev, struct label **labelp, uint64_t scan_s
 int label_scan_setup_bcache(void)
 {
 	if (!scan_bcache) {
-		if (!_setup_bcache(32))
+		if (!_setup_bcache(0))
 			return 0;
 	}
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* master - scan: create bcache with minimum number of blocks
@ 2018-04-23 13:55 David Teigland
  0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2018-04-23 13:55 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=21057676a1f01c6b1f19b2e879d8385d76adb517
Commit:        21057676a1f01c6b1f19b2e879d8385d76adb517
Parent:        e49b114f7e437666caefa04aada31f32820e286e
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Feb 27 12:35:45 2018 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Apr 20 11:22:47 2018 -0500

scan: create bcache with minimum number of blocks

In some odd cases (e.g. tests) there are very few devices
which results in creating too few blocks in bcache, so
create bcache with a minimum number of blocks.
---
 lib/label/label.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/label/label.c b/lib/label/label.c
index 45a3ecf..88001a9 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -560,13 +560,15 @@ static int _scan_list(struct dm_list *devs, int *failed)
 	return 1;
 }
 
+#define MIN_BCACHE_BLOCKS 32
+
 static int _setup_bcache(int cache_blocks)
 {
 	struct io_engine *ioe;
 
 	/* No devices can happen, just create bcache with any small number. */
-	if (!cache_blocks)
-		cache_blocks = 8;
+	if (cache_blocks < MIN_BCACHE_BLOCKS)
+		cache_blocks = MIN_BCACHE_BLOCKS;
 
 	/*
 	 * 100 is arbitrary, it's the max number of concurrent aio's
@@ -831,7 +833,7 @@ int label_read_sector(struct device *dev, struct label **labelp, uint64_t scan_s
 int label_scan_setup_bcache(void)
 {
 	if (!scan_bcache) {
-		if (!_setup_bcache(32))
+		if (!_setup_bcache(0))
 			return 0;
 	}
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-23 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 13:51 master - scan: create bcache with minimum number of blocks David Teigland
2018-04-23 13:55 David Teigland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.