From 4f2c166ebe5baef20e28866b27dd97b0caa585f1 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 4 Jun 2023 18:08:56 -0400 Subject: [PATCH] bcachefs: Fix bch2_fsck_ask_yn() - getline() output includes a newline, without stripping that we were just looping - Make the prompt clearer Signed-off-by: Kent Overstreet --- fs/bcachefs/error.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index 545c55dabc277..b08cd23dee005 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -85,12 +85,13 @@ enum ask_yn bch2_fsck_ask_yn(void) bool ret; while (true) { - fputs(" (y,n,Y,N) ", stdout); + fputs(" (y,n, or Y,N for all errors of this type) ", stdout); fflush(stdout); if (getline(&buf, &buflen, stdin) < 0) die("error reading from standard input"); + strim(buf); if (strlen(buf) != 1) continue; -- 2.30.2