Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: output sectorsize related warning message into stdout
Date: Tue,  9 Mar 2021 15:39:09 +0800	[thread overview]
Message-ID: <20210309073909.74043-1-wqu@suse.com> (raw)

Since commit 90020a760584 ("btrfs-progs: mkfs: refactor how we handle
sectorsize override") we have extra warning message if the sectorsize of
mkfs doesn't match page size.

But this warning is show as stderr, which makes a lot of fstests cases
failure due to golden output mismatch.

Fix this by manually output the warning message as stdout.

This is just a temporary fix, a proper fix would needs kernel
/sys/fs/btrfs/features/supported_rw_sectorsize interface to do proper
prompt.

Fixes: 90020a760584 ("btrfs-progs: mkfs: refactor how we handle sectorsize override")
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 common/fsfeatures.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/common/fsfeatures.c b/common/fsfeatures.c
index 569208a9e5b1..f9492e30d57a 100644
--- a/common/fsfeatures.c
+++ b/common/fsfeatures.c
@@ -341,8 +341,16 @@ int btrfs_check_sectorsize(u32 sectorsize)
 		return -EINVAL;
 	}
 	if (page_size != sectorsize)
-		warning(
-"the filesystem may not be mountable, sectorsize %u doesn't match page size %u",
+		/*
+		 * warning() will output message into stderr, which will screw
+		 * up a lot of golden output of fstests. So here we use
+		 * printf().
+		 *
+		 * This will be replaced by proper supported rw/ro sector size
+		 * detection with kernel change in the future.
+		 */
+		printf(
+"WARNING: the filesystem may not be mountable, sectorsize %u doesn't match page size %u\n",
 			sectorsize, page_size);
 	return 0;
 }
-- 
2.30.1


             reply	other threads:[~2021-03-09  7:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  7:39 Qu Wenruo [this message]
2021-03-09 13:33 ` [PATCH] btrfs-progs: output sectorsize related warning message into stdout David Sterba
2021-03-10  0:18   ` Qu Wenruo
2021-03-10  9:08     ` David Sterba

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=20210309073909.74043-1-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox