All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - writecache: use block size 4096 when no fs is found
Date: Wed, 23 Jun 2021 17:41:35 +0000 (GMT)	[thread overview]
Message-ID: <20210623174135.659AA38515D5@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=84bd394cf9aaa581b4bf980f764544dda26a0305
Commit:        84bd394cf9aaa581b4bf980f764544dda26a0305
Parent:        1139a05939f85bd86a756b451a8f194bc7a72a2c
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Jun 23 12:38:57 2021 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Wed Jun 23 12:38:57 2021 -0500

writecache: use block size 4096 when no fs is found

When there is no block size constraint from a file system
or from a user setting, use 4096 rather than 512 because of
better performance.
---
 tools/lvconvert.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index cbe4fa93a..ab8b42b7e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5992,24 +5992,13 @@ static int _set_writecache_block_size(struct cmd_context *cmd,
 	rv = get_fs_block_size(pathname, &fs_block_size);
 skip_fs:
 	if (!rv || !fs_block_size) {
-		if (lbs_4k && pbs_4k && !pbs_512) {
+		if (block_size_setting)
+			block_size = block_size_setting;
+		else
 			block_size = 4096;
-		} else if (lbs_512 && pbs_512 && !pbs_4k) {
-			block_size = 512;
-		} else if (lbs_512 && pbs_4k) {
-			if (block_size_setting == 4096)
-				block_size = 4096;
-			else
-				block_size = 512;
-		} else {
-			block_size = 512;
-		}
 
-		if (block_size_setting && (block_size_setting != block_size)) {
-			log_warn("WARNING: writecache block size %u does not match device block sizes, logical %u physical %u",
-				 block_size_setting, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
-			block_size = block_size_setting;
-		}
+		log_print("Using writecache block size %u for unknown file system block size, logical block size %u, physical block size %u.",
+			 block_size, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
 
 		if (block_size != 512) {
 			log_warn("WARNING: unable to detect a file system block size on %s", display_lvname(lv));
@@ -6021,8 +6010,6 @@ skip_fs:
 			}
 		}
 
-		log_print("Using writecache block size %u for unknown file system block size, logical block size %u, physical block size %u.",
-			 block_size, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
 		goto out;
 	}
 



                 reply	other threads:[~2021-06-23 17:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210623174135.659AA38515D5@sourceware.org \
    --to=teigland@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.