From patchwork Sun Dec 31 22:38:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507921 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F695C147 for ; Sun, 31 Dec 2023 22:38:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pZk0YVC2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AAC8C433C8; Sun, 31 Dec 2023 22:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062312; bh=KC9ELear0CoIIqddJbwKJUL6S58Vzr5a9kpJ0rhL3+o=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=pZk0YVC22yi1UN7bj04gvSecChNxTXvP0WC2oY7mEJTvgU6w78eAcrGO1bJnxmj68 YKK26vjiTKBD45EcMQA+LrGRQeOU5uwA6RV9VU9w0dFQz0G2/r810KzLjutveHFeBF PTPmngAeuMLNPsdFIcicnF7THKaIZI44heK0xcS3qsmyOOUy/dK5KRXxa+X0bcs9kl lvm2tFnAb3CGABFpMYE/+3VFhC4mHrD85CNFhPctX5/8Akix5aoQog0979ht2yG96K Xq1EGiJQJxdZu7gtEyzp1b1OwY6qqK3ozJI7T2FDjnO7QCxt6v91bpLk/2xaCoAp2j pThV84gG/Up2A== Date: Sun, 31 Dec 2023 14:38:31 -0800 Subject: [PATCH 1/8] xfs_scrub: fix missing scrub coverage for broken inodes From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999048.1797544.5322672088708731038.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong If INUMBERS says that an inode is allocated, but BULKSTAT skips over the inode and BULKSTAT_SINGLE errors out when loading the inumber, there are two possibilities: One, we're racing with ifree; or two, the inode is corrupt and iget failed. When this happens, the scrub_scan_all_inodes code will insert a dummy bulkstat record with all fields zeroed except bs_ino and bs_blksize. Hence the use of i_mode switches in phase3 to schedule file content scrubbing are not entirely correct -- bs_mode==0 means "type unknown", which ought to mean "schedule all scrubbers". Unfortunately, the current code doesn't do that, so instead we schedule no content scrubs. If the broken file was actually a directory, we fail to check the directory contents for further corruptions. Found by using fuzzing with xfs/385 and core.format = 0. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/phase3.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/scrub/phase3.c b/scrub/phase3.c index 9a26b92036c..b03b55250a3 100644 --- a/scrub/phase3.c +++ b/scrub/phase3.c @@ -166,16 +166,29 @@ scrub_inode( if (error) goto out; - if (S_ISLNK(bstat->bs_mode)) { + /* + * Check file data contents, e.g. symlink and directory entries. + * + * Note: bs_mode==0 occurs when inumbers says an inode is allocated, + * bulkstat skips the inode, and bulkstat_single errors out when + * loading the inode. This could be due to racing with ifree, but it + * could be a corrupt inode. Either way, schedule all the data fork + * content scrubbers. Better to have them return -ENOENT than miss + * some coverage. + */ + if (S_ISLNK(bstat->bs_mode) || !bstat->bs_mode) { /* Check symlink contents. */ error = scrub_file(ctx, fd, bstat, XFS_SCRUB_TYPE_SYMLINK, &alist); - } else if (S_ISDIR(bstat->bs_mode)) { + if (error) + goto out; + } + if (S_ISDIR(bstat->bs_mode) || !bstat->bs_mode) { /* Check the directory entries. */ error = scrub_file(ctx, fd, bstat, XFS_SCRUB_TYPE_DIR, &alist); + if (error) + goto out; } - if (error) - goto out; /* Check all the extended attributes. */ error = scrub_file(ctx, fd, bstat, XFS_SCRUB_TYPE_XATTR, &alist); From patchwork Sun Dec 31 22:38:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507922 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2A86C13B for ; Sun, 31 Dec 2023 22:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TwSB4S71" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE919C433C7; Sun, 31 Dec 2023 22:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062327; bh=agmbz1bWrUc76dlx0Yu1nHcbDIIr6c77TqYBACxspdg=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=TwSB4S71UB2n9twHD+IX7j+bTgi9Z+/LcFBmZorgkMQ8O8CsqfFkoLMdDhmgtBbTM GSSD9SimUz8aidDlKlm6ADQ6WrKrsEAFO26vL/+TdBYN7iEtFHc9lJOU9Scelycqtf L2ZvUFgelfJHd7Miq0bDolmTkDccccc/prd6PlTKqClBLzVyLVO8D0d0shRNq14yuC NvPIk1pIS2jcNnQ+BxUMgNTkuDEzMW6BzmHZynhUHpRlXmEgjorc0fIKzdScik8e21 H9OHThqMKWFLAdpnNSfTIFNBLwyFT5itgGqnxUsUJNiE+t3/jVixqPltKM7K9ZyLIJ 1iE5HYeVXOXQw== Date: Sun, 31 Dec 2023 14:38:47 -0800 Subject: [PATCH 2/8] xfs_scrub: collapse trivial superblock scrub helpers From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999061.1797544.15540940981670714039.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Remove the trivial primary super scrub helper function since it makes tracing code paths difficult and will become annoying in the patches that follow. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/phase2.c | 9 +++++---- scrub/scrub.c | 16 +--------------- scrub/scrub.h | 3 ++- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/scrub/phase2.c b/scrub/phase2.c index 2d49c604eae..ec72bb5b71a 100644 --- a/scrub/phase2.c +++ b/scrub/phase2.c @@ -166,12 +166,13 @@ phase2_func( } /* - * In case we ever use the primary super scrubber to perform fs - * upgrades (followed by a full scrub), do that before we launch - * anything else. + * Scrub primary superblock. This will be useful if we ever need to + * hook a filesystem-wide pre-scrub activity (e.g. enable filesystem + * upgrades) off of the sb 0 scrubber (which currently does nothing). + * If errors occur, this function will log them and return nonzero. */ action_list_init(&alist); - ret = scrub_primary_super(ctx, &alist); + ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_SB, 0, &alist); if (ret) goto out_wq; ret = action_list_process(ctx, -1, &alist, diff --git a/scrub/scrub.c b/scrub/scrub.c index 59583913031..c2e56e5f1cb 100644 --- a/scrub/scrub.c +++ b/scrub/scrub.c @@ -259,7 +259,7 @@ scrub_save_repair( * Returns 0 for success. If errors occur, this function will log them and * return a positive error code. */ -static int +int scrub_meta_type( struct scrub_ctx *ctx, unsigned int type, @@ -325,20 +325,6 @@ scrub_group( return 0; } -/* - * Scrub primary superblock. This will be useful if we ever need to hook - * a filesystem-wide pre-scrub activity off of the sb 0 scrubber (which - * currently does nothing). If errors occur, this function will log them and - * return nonzero. - */ -int -scrub_primary_super( - struct scrub_ctx *ctx, - struct action_list *alist) -{ - return scrub_meta_type(ctx, XFS_SCRUB_TYPE_SB, 0, alist); -} - /* Scrub each AG's header blocks. */ int scrub_ag_headers( diff --git a/scrub/scrub.h b/scrub/scrub.h index 133445e8da6..fef8a596049 100644 --- a/scrub/scrub.h +++ b/scrub/scrub.h @@ -17,7 +17,6 @@ enum check_outcome { struct action_item; void scrub_report_preen_triggers(struct scrub_ctx *ctx); -int scrub_primary_super(struct scrub_ctx *ctx, struct action_list *alist); int scrub_ag_headers(struct scrub_ctx *ctx, xfs_agnumber_t agno, struct action_list *alist); int scrub_ag_metadata(struct scrub_ctx *ctx, xfs_agnumber_t agno, @@ -30,6 +29,8 @@ int scrub_fs_counters(struct scrub_ctx *ctx, struct action_list *alist); int scrub_quotacheck(struct scrub_ctx *ctx, struct action_list *alist); int scrub_nlinks(struct scrub_ctx *ctx, struct action_list *alist); int scrub_clean_health(struct scrub_ctx *ctx, struct action_list *alist); +int scrub_meta_type(struct scrub_ctx *ctx, unsigned int type, + xfs_agnumber_t agno, struct action_list *alist); bool can_scrub_fs_metadata(struct scrub_ctx *ctx); bool can_scrub_inode(struct scrub_ctx *ctx); From patchwork Sun Dec 31 22:39:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507923 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1FB0C140 for ; Sun, 31 Dec 2023 22:39:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lGt94RRz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 949ECC433C8; Sun, 31 Dec 2023 22:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062343; bh=XD/MsUI6VAxwCnirEH4XrZReYRsCL/4OaUZTOepuo5M=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=lGt94RRzENcl4BkQGUtsgRvlWo3qSMJpQYvWRmwKPruEhRL7gwdSgMoO7VvJDtBzh pwSC8a/XUK5o20skVu17R5KjdGOsUwDp1nwtZL9BXloofEtFsXbTd6atAjupZibktg vpp6xS01an19wYAyAUWfBgZp1iJZkKd03/nlf0VQR+eCbgQYTNFWss1WX3Yfbm2rCZ ypLQelrAkQzdH3UkA5CN1adhwD5R19SHg60diOGDHSsdb6E8k8XQIobKv3XXzz/FRN 60I8L7D4hDzEQlwqjxjliUQNLe/A2zMB6GS6A5wR9UDf74SUHbq71NUHcA+sxk44Vy SjfnQi64dMEWA== Date: Sun, 31 Dec 2023 14:39:02 -0800 Subject: [PATCH 3/8] xfs_scrub: get rid of trivial fs metadata scanner helpers From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999074.1797544.12862346087688523993.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Get rid of these pointless wrappers. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/phase1.c | 2 +- scrub/phase4.c | 9 +++++---- scrub/phase5.c | 15 +++++++-------- scrub/scrub.c | 36 ------------------------------------ scrub/scrub.h | 4 ---- 5 files changed, 13 insertions(+), 53 deletions(-) diff --git a/scrub/phase1.c b/scrub/phase1.c index 81b0918a1c8..a61e154a84a 100644 --- a/scrub/phase1.c +++ b/scrub/phase1.c @@ -61,7 +61,7 @@ report_to_kernel( return 0; action_list_init(&alist); - ret = scrub_clean_health(ctx, &alist); + ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_HEALTHY, 0, &alist); if (ret) return ret; diff --git a/scrub/phase4.c b/scrub/phase4.c index 0c67abf64a3..d01dc89f44f 100644 --- a/scrub/phase4.c +++ b/scrub/phase4.c @@ -136,14 +136,14 @@ phase4_func( goto maybe_trim; /* - * Check the summary counters early. Normally we do this during phase - * seven, but some of the cross-referencing requires fairly accurate + * Check the resource usage counters early. Normally we do this during + * phase 7, but some of the cross-referencing requires fairly accurate * summary counters. Check and try to repair them now to minimize the * chance that repairs of primary metadata fail due to secondary * metadata. If repairs fails, we'll come back during phase 7. */ action_list_init(&alist); - ret = scrub_fs_counters(ctx, &alist); + ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_FSCOUNTERS, 0, &alist); if (ret) return ret; @@ -158,7 +158,8 @@ phase4_func( return ret; if (fsgeom.sick & XFS_FSOP_GEOM_SICK_QUOTACHECK) { - ret = scrub_quotacheck(ctx, &alist); + ret = scrub_meta_type(ctx, XFS_SCRUB_TYPE_QUOTACHECK, 0, + &alist); if (ret) return ret; } diff --git a/scrub/phase5.c b/scrub/phase5.c index 940e434c3cd..68d35cd5852 100644 --- a/scrub/phase5.c +++ b/scrub/phase5.c @@ -384,12 +384,10 @@ check_fs_label( return error; } -typedef int (*fs_scan_item_fn)(struct scrub_ctx *, struct action_list *); - struct fs_scan_item { struct action_list alist; bool *abortedp; - fs_scan_item_fn scrub_fn; + unsigned int scrub_type; }; /* Run one full-fs scan scrubber in this thread. */ @@ -414,7 +412,7 @@ fs_scan_worker( nanosleep(&tv, NULL); } - ret = item->scrub_fn(ctx, &item->alist); + ret = scrub_meta_type(ctx, item->scrub_type, 0, &item->alist); if (ret) { str_liberror(ctx, ret, _("checking fs scan metadata")); *item->abortedp = true; @@ -440,7 +438,7 @@ queue_fs_scan( struct workqueue *wq, bool *abortedp, xfs_agnumber_t nr, - fs_scan_item_fn scrub_fn) + unsigned int scrub_type) { struct fs_scan_item *item; struct scrub_ctx *ctx = wq->wq_ctx; @@ -453,7 +451,7 @@ queue_fs_scan( return ret; } action_list_init(&item->alist); - item->scrub_fn = scrub_fn; + item->scrub_type = scrub_type; item->abortedp = abortedp; ret = -workqueue_add(wq, fs_scan_worker, nr, item); @@ -485,14 +483,15 @@ run_kernel_fs_scan_scrubbers( * The nlinks scanner is much faster than quotacheck because it only * walks directories, so we start it first. */ - ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, scrub_nlinks); + ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, XFS_SCRUB_TYPE_NLINKS); if (ret) goto wait; if (nr_threads > 1) nr++; - ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, scrub_quotacheck); + ret = queue_fs_scan(&wq_fs_scan, &aborted, nr, + XFS_SCRUB_TYPE_QUOTACHECK); if (ret) goto wait; diff --git a/scrub/scrub.c b/scrub/scrub.c index c2e56e5f1cb..6e857c79dfb 100644 --- a/scrub/scrub.c +++ b/scrub/scrub.c @@ -366,42 +366,6 @@ scrub_summary_metadata( return scrub_group(ctx, XFROG_SCRUB_GROUP_SUMMARY, 0, alist); } -/* Scrub /only/ the superblock summary counters. */ -int -scrub_fs_counters( - struct scrub_ctx *ctx, - struct action_list *alist) -{ - return scrub_meta_type(ctx, XFS_SCRUB_TYPE_FSCOUNTERS, 0, alist); -} - -/* Scrub /only/ the quota counters. */ -int -scrub_quotacheck( - struct scrub_ctx *ctx, - struct action_list *alist) -{ - return scrub_meta_type(ctx, XFS_SCRUB_TYPE_QUOTACHECK, 0, alist); -} - -/* Scrub /only/ the file link counters. */ -int -scrub_nlinks( - struct scrub_ctx *ctx, - struct action_list *alist) -{ - return scrub_meta_type(ctx, XFS_SCRUB_TYPE_NLINKS, 0, alist); -} - -/* Update incore health records if we were clean. */ -int -scrub_clean_health( - struct scrub_ctx *ctx, - struct action_list *alist) -{ - return scrub_meta_type(ctx, XFS_SCRUB_TYPE_HEALTHY, 0, alist); -} - /* How many items do we have to check? */ unsigned int scrub_estimate_ag_work( diff --git a/scrub/scrub.h b/scrub/scrub.h index fef8a596049..98819a25b62 100644 --- a/scrub/scrub.h +++ b/scrub/scrub.h @@ -25,10 +25,6 @@ int scrub_fs_metadata(struct scrub_ctx *ctx, unsigned int scrub_type, struct action_list *alist); int scrub_iscan_metadata(struct scrub_ctx *ctx, struct action_list *alist); int scrub_summary_metadata(struct scrub_ctx *ctx, struct action_list *alist); -int scrub_fs_counters(struct scrub_ctx *ctx, struct action_list *alist); -int scrub_quotacheck(struct scrub_ctx *ctx, struct action_list *alist); -int scrub_nlinks(struct scrub_ctx *ctx, struct action_list *alist); -int scrub_clean_health(struct scrub_ctx *ctx, struct action_list *alist); int scrub_meta_type(struct scrub_ctx *ctx, unsigned int type, xfs_agnumber_t agno, struct action_list *alist); From patchwork Sun Dec 31 22:39:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507924 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B0CFC13B for ; Sun, 31 Dec 2023 22:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oLsnZMN4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40A81C433C7; Sun, 31 Dec 2023 22:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062359; bh=WreobNVSv7kVyKAkovU7uLutbDKOSJ/C5RerrEm1eUk=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=oLsnZMN4/Ha2g+0PZXDWtmAU+aIlfRBCz64gJRW1m+m2gG7kJxb8TGanEGCgW7M6i BDzkKD00ye+ztcmkbBvsKGjLcAYiJeO1NL+lUCrrmqEc7hu487m/3YcBD+Pc9KO7lz xVDTE44nqNwWIck0sg/xn71lP0tq2ITn+pC+53RkZacOjRDMSyDtrzLBH2H7opPQck i3CVbju9dTf0e8tztIzOR4cyndEIFLXpeJwUDbRZmNj8iXvg8p6YL+iJm9+kyhrrF8 RMtRbfCnYuaSKg34idUYBs0RnTv8cbOOdTttekwqsgbR0xpOKu5vDcFMtI4DGoyG1f 4uQXxZ/5ygTGg== Date: Sun, 31 Dec 2023 14:39:18 -0800 Subject: [PATCH 4/8] xfs_scrub: split up the mustfix repairs and difficulty assessment functions From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999088.1797544.11934780065637381281.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Currently, action_list_find_mustfix does two things -- it figures out which repairs must be tried during phase 2 to enable the inode scan in phase 3; and it figures out if xfs_scrub should warn about secondary and primary metadata corruption that might make repair difficult. Split these into separate functions to make each more coherent. A long time from now we'll need this to enable warnings about difficult rt repairs, but for now this is merely a code cleanup. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/phase2.c | 15 +++++++-------- scrub/repair.c | 38 +++++++++++++++++++++++++++----------- scrub/repair.h | 10 +++++++--- 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/scrub/phase2.c b/scrub/phase2.c index ec72bb5b71a..4c0d20a8e2b 100644 --- a/scrub/phase2.c +++ b/scrub/phase2.c @@ -42,9 +42,8 @@ scan_ag_metadata( struct scan_ctl *sctl = arg; struct action_list alist; struct action_list immediate_alist; - unsigned long long broken_primaries; - unsigned long long broken_secondaries; char descr[DESCR_BUFSZ]; + unsigned int difficulty; int ret; if (sctl->aborted) @@ -79,12 +78,12 @@ scan_ag_metadata( * the inobt from rmapbt data, but if the rmapbt is broken even * at this early phase then we are sunk. */ - broken_secondaries = 0; - broken_primaries = 0; - action_list_find_mustfix(&alist, &immediate_alist, - &broken_primaries, &broken_secondaries); - if (broken_secondaries && !debug_tweak_on("XFS_SCRUB_FORCE_REPAIR")) { - if (broken_primaries) + difficulty = action_list_difficulty(&alist); + action_list_find_mustfix(&alist, &immediate_alist); + + if ((difficulty & REPAIR_DIFFICULTY_SECONDARY) && + !debug_tweak_on("XFS_SCRUB_FORCE_REPAIR")) { + if (difficulty & REPAIR_DIFFICULTY_PRIMARY) str_info(ctx, descr, _("Corrupt primary and secondary block mapping metadata.")); else diff --git a/scrub/repair.c b/scrub/repair.c index 50f168d24fe..8ee9102ab58 100644 --- a/scrub/repair.c +++ b/scrub/repair.c @@ -290,9 +290,7 @@ xfs_action_item_compare( void action_list_find_mustfix( struct action_list *alist, - struct action_list *immediate_alist, - unsigned long long *broken_primaries, - unsigned long long *broken_secondaries) + struct action_list *immediate_alist) { struct action_item *n; struct action_item *aitem; @@ -301,25 +299,43 @@ action_list_find_mustfix( if (!(aitem->flags & XFS_SCRUB_OFLAG_CORRUPT)) continue; switch (aitem->type) { - case XFS_SCRUB_TYPE_RMAPBT: - (*broken_secondaries)++; - break; case XFS_SCRUB_TYPE_FINOBT: case XFS_SCRUB_TYPE_INOBT: alist->nr--; list_move_tail(&aitem->list, &immediate_alist->list); immediate_alist->nr++; - fallthrough; + break; + } + } +} + +/* Determine if primary or secondary metadata are inconsistent. */ +unsigned int +action_list_difficulty( + const struct action_list *alist) +{ + struct action_item *aitem, *n; + unsigned int ret = 0; + + list_for_each_entry_safe(aitem, n, &alist->list, list) { + if (!(aitem->flags & XFS_SCRUB_OFLAG_CORRUPT)) + continue; + + switch (aitem->type) { + case XFS_SCRUB_TYPE_RMAPBT: + ret |= REPAIR_DIFFICULTY_SECONDARY; + break; + case XFS_SCRUB_TYPE_FINOBT: + case XFS_SCRUB_TYPE_INOBT: case XFS_SCRUB_TYPE_BNOBT: case XFS_SCRUB_TYPE_CNTBT: case XFS_SCRUB_TYPE_REFCNTBT: - (*broken_primaries)++; - break; - default: - abort(); + ret |= REPAIR_DIFFICULTY_PRIMARY; break; } } + + return ret; } /* diff --git a/scrub/repair.h b/scrub/repair.h index 6b6f64691a3..b61bd29c860 100644 --- a/scrub/repair.h +++ b/scrub/repair.h @@ -28,9 +28,13 @@ void action_list_discard(struct action_list *alist); void action_list_splice(struct action_list *dest, struct action_list *src); void action_list_find_mustfix(struct action_list *actions, - struct action_list *immediate_alist, - unsigned long long *broken_primaries, - unsigned long long *broken_secondaries); + struct action_list *immediate_alist); + +/* Primary metadata is corrupt */ +#define REPAIR_DIFFICULTY_PRIMARY (1U << 0) +/* Secondary metadata is corrupt */ +#define REPAIR_DIFFICULTY_SECONDARY (1U << 1) +unsigned int action_list_difficulty(const struct action_list *actions); /* * Only ask the kernel to repair this object if the kernel directly told us it From patchwork Sun Dec 31 22:39:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507925 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17E98C129 for ; Sun, 31 Dec 2023 22:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kqRqo8wN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7024C433C7; Sun, 31 Dec 2023 22:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062374; bh=CsMPM9JK6l7W6cq10lnyXmVEP0NQdu2M4EhcrPjvXcw=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=kqRqo8wNcdYpgr3pNA38J0psVeuC4OWMj/zSRrBdeCNC2pMCQeCSFr+oy2Q0TTTyv wiFyi4uJ8mK0PkUw2kcK+JU2DX/GvYwVbOdtbpz20kqGfvz7GZNIcxluITig3e4oYj TlMHix71Ubx1Ixv22xQKXHvA+BU05kbAkUkG9w0CTtG6hK4yYUBixu8/8TNNHHmpSn sbSHg1fWOIHWF714bfSW+mHoFngpFuz/GB5Rp2JYqZl2dm9YQ41RCBOFrEWWaJHzpO BKKGuhQrcWssU6c7tB9fbq1pBZWO5Yy/Y92FoqV9t/dLHPz3RnYJF2QCdI/ae3sfjw wr8nCeeSubY5Q== Date: Sun, 31 Dec 2023 14:39:34 -0800 Subject: [PATCH 5/8] xfs_scrub: add missing repair types to the mustfix and difficulty assessment From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999101.1797544.8999383600020985389.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Add a few scrub types that ought to trigger a mustfix (such as AGI corruption) and all the AG space metadata to the repair difficulty assessment. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/repair.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scrub/repair.c b/scrub/repair.c index 8ee9102ab58..33a8031103c 100644 --- a/scrub/repair.c +++ b/scrub/repair.c @@ -299,6 +299,7 @@ action_list_find_mustfix( if (!(aitem->flags & XFS_SCRUB_OFLAG_CORRUPT)) continue; switch (aitem->type) { + case XFS_SCRUB_TYPE_AGI: case XFS_SCRUB_TYPE_FINOBT: case XFS_SCRUB_TYPE_INOBT: alist->nr--; @@ -325,11 +326,17 @@ action_list_difficulty( case XFS_SCRUB_TYPE_RMAPBT: ret |= REPAIR_DIFFICULTY_SECONDARY; break; + case XFS_SCRUB_TYPE_SB: + case XFS_SCRUB_TYPE_AGF: + case XFS_SCRUB_TYPE_AGFL: + case XFS_SCRUB_TYPE_AGI: case XFS_SCRUB_TYPE_FINOBT: case XFS_SCRUB_TYPE_INOBT: case XFS_SCRUB_TYPE_BNOBT: case XFS_SCRUB_TYPE_CNTBT: case XFS_SCRUB_TYPE_REFCNTBT: + case XFS_SCRUB_TYPE_RTBITMAP: + case XFS_SCRUB_TYPE_RTSUM: ret |= REPAIR_DIFFICULTY_PRIMARY; break; } From patchwork Sun Dec 31 22:39:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507926 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D42ABA45 for ; Sun, 31 Dec 2023 22:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G+kzWlrb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83E26C433C7; Sun, 31 Dec 2023 22:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062390; bh=vei+qV6JcPrizFGOVqw2QfZzFxT4QPGzKKNq9mown1Y=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=G+kzWlrbZkkU6tbq5EyQ2vJ6IQ/Fb7EITO62BDTNRrOPEkiXR2FSyskHM+8hQMTWs H+rJriXbNtQWfuy8ZQl5M7WNyRBs969wvYho02UuD4ZfOekqLEnKf0i1OFOMTKc5+s VJqUndCI5RMNujWzD1U0/2avhpvy/FKPLW4ibn9nkp94cuHVErfjCSEunyWOjgHNLR pPitYQaugEbn27ScoYF8xPnPmCS8As2nSNy3gTDRp9omRfvo/WfA/wnRs+L8EIRcOi /+/DfGNpcR3rzPd5FB3B2951zFPHBPFu99XoP4hqVTzvlKO6oZreDG4yw1XM+5Kt2y qHd0K10Va4Usg== Date: Sun, 31 Dec 2023 14:39:50 -0800 Subject: [PATCH 6/8] xfs_scrub: any inconsistency in metadata should trigger difficulty warnings From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999114.1797544.6397356360236587838.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Any inconsistency in the space metadata can be a sign that repairs will be difficult, so set off the warning if there were cross referencing problems too. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/repair.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrub/repair.c b/scrub/repair.c index 33a8031103c..30817d268d6 100644 --- a/scrub/repair.c +++ b/scrub/repair.c @@ -319,7 +319,9 @@ action_list_difficulty( unsigned int ret = 0; list_for_each_entry_safe(aitem, n, &alist->list, list) { - if (!(aitem->flags & XFS_SCRUB_OFLAG_CORRUPT)) + if (!(aitem->flags & (XFS_SCRUB_OFLAG_CORRUPT | + XFS_SCRUB_OFLAG_XCORRUPT | + XFS_SCRUB_OFLAG_XFAIL))) continue; switch (aitem->type) { From patchwork Sun Dec 31 22:40:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507927 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2E3AC129 for ; Sun, 31 Dec 2023 22:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dL/rm4hQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 382DAC433C8; Sun, 31 Dec 2023 22:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062406; bh=7IYADfGJamKImTGjLXO7Huyg69J0aq2sfINXDk7E250=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=dL/rm4hQxVnoEpydbFNReGk5qPsGgaBfUcHG2kRPQS4y1NN7Yo3BKbyOKPPYzVqjs VFl1VOw3QERyN408jIB1VSOohHfob1d5OU8LRkqc36kPh0PZa7YLrL9vKAJ7RviU7Y ohuIjco+UXkc/WgTSE2ckHoFnJRUQthg4Gc0eQFx7sIT2+MJ2gEpSb/tOqElIk4dYM itRLwnoLVx7SLxOiD9gSQuyrlWnjSlWLwa1XfYCVoOgurJ42NUah0Nyc2PhVus1v4V 7QHWYmBxxXykG2AdiCJ2QQPb/GMFrW+V65/nsGbL1VGOQ3HprpR3chGLhHeim/16qw Ib/qyVc7kXd3A== Date: Sun, 31 Dec 2023 14:40:05 -0800 Subject: [PATCH 7/8] xfs_scrub: warn about difficult repairs to rt and quota metadata From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999127.1797544.4265175049929354672.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Warn the user if there are problems with the rt or quota metadata that might make repairs difficult. For now there aren't any corruption conditions that would trigger this, but we don't want to leave a gap. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/phase2.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/scrub/phase2.c b/scrub/phase2.c index 4c0d20a8e2b..3e88c969b43 100644 --- a/scrub/phase2.c +++ b/scrub/phase2.c @@ -31,6 +31,25 @@ struct scan_ctl { bool aborted; }; +/* Warn about the types of mutual inconsistencies that may make repairs hard. */ +static inline void +warn_repair_difficulties( + struct scrub_ctx *ctx, + unsigned int difficulty, + const char *descr) +{ + if (!(difficulty & REPAIR_DIFFICULTY_SECONDARY)) + return; + if (debug_tweak_on("XFS_SCRUB_FORCE_REPAIR")) + return; + + if (difficulty & REPAIR_DIFFICULTY_PRIMARY) + str_info(ctx, descr, _("Corrupt primary and secondary metadata.")); + else + str_info(ctx, descr, _("Corrupt secondary metadata.")); + str_info(ctx, descr, _("Filesystem might not be repairable.")); +} + /* Scrub each AG's metadata btrees. */ static void scan_ag_metadata( @@ -80,18 +99,7 @@ scan_ag_metadata( */ difficulty = action_list_difficulty(&alist); action_list_find_mustfix(&alist, &immediate_alist); - - if ((difficulty & REPAIR_DIFFICULTY_SECONDARY) && - !debug_tweak_on("XFS_SCRUB_FORCE_REPAIR")) { - if (difficulty & REPAIR_DIFFICULTY_PRIMARY) - str_info(ctx, descr, -_("Corrupt primary and secondary block mapping metadata.")); - else - str_info(ctx, descr, -_("Corrupt secondary block mapping metadata.")); - str_info(ctx, descr, -_("Filesystem might not be repairable.")); - } + warn_repair_difficulties(ctx, difficulty, descr); /* Repair (inode) btree damage. */ ret = action_list_process_or_defer(ctx, agno, &immediate_alist); @@ -115,6 +123,7 @@ scan_fs_metadata( struct action_list alist; struct scrub_ctx *ctx = (struct scrub_ctx *)wq->wq_ctx; struct scan_ctl *sctl = arg; + unsigned int difficulty; int ret; if (sctl->aborted) @@ -127,6 +136,10 @@ scan_fs_metadata( goto out; } + /* Complain about metadata corruptions that might not be fixable. */ + difficulty = action_list_difficulty(&alist); + warn_repair_difficulties(ctx, difficulty, xfrog_scrubbers[type].descr); + action_list_defer(ctx, 0, &alist); out: From patchwork Sun Dec 31 22:40:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507928 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B4C9C129 for ; Sun, 31 Dec 2023 22:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I11ebOOm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9888C433C7; Sun, 31 Dec 2023 22:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704062421; bh=vU/BPQkz3DHfoH1ONjjXzCiC5c9AphgxgViclvSnoPM=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=I11ebOOmRulfYklDx05yD+UkkEY7TGLBGkAz6iR7CuHRd85zrZyebYgUbJkkFA5Pl hfcHPsW8gw1zzvvn+vblQ1F0Yk2x52WOsplT/pRn3Pg3LxpBjUpDHTm8w7KbxaCUx1 6AGMMmtGHWd0Jw8E7te5fE/xVAg5a8xcBUOqH7+J8adMiz0/YXfc3baOZFl8BQEVNW fpDEf+bx4oDgjssTz40DB9Z1SA6yjr99AgT6o1aNgFtJ+PL1n8g8tQYltKtou+zrcW gF+UtKXugxGC1mDD3O9rMCEvhcTloXpluwnmo3W+pqA+AN6GemBJ5Si4DnS4B/R6K+ t1Uv2+9/aMTXw== Date: Sun, 31 Dec 2023 14:40:21 -0800 Subject: [PATCH 8/8] xfs_scrub: enable users to bump information messages to warnings From: "Darrick J. Wong" To: djwong@kernel.org, cem@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404999140.1797544.9880902340998334029.stgit@frogsfrogsfrogs> In-Reply-To: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> References: <170404999029.1797544.5974682335470417611.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Add a -o iwarn option that enables users to specify that informational messages (such as incomplete scans, or confusing names) should be treated as warnings. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- man/man8/xfs_scrub.8 | 19 +++++++++++++++++++ scrub/common.c | 2 ++ scrub/xfs_scrub.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- scrub/xfs_scrub.h | 1 + 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/man/man8/xfs_scrub.8 b/man/man8/xfs_scrub.8 index e881ae76acb..404baba696e 100644 --- a/man/man8/xfs_scrub.8 +++ b/man/man8/xfs_scrub.8 @@ -85,6 +85,25 @@ Search this file for mounted filesystems instead of /etc/mtab. .B \-n Only check filesystem metadata. Do not repair or optimize anything. +.HP +.B \-o +.I subopt\c +[\c +.B =\c +.IR value ] +.BR +Override what the program might conclude about the filesystem +if left to its own devices. +.IP +The +.IR subopt ions +supported are: +.RS 1.0i +.TP +.BI iwarn +Treat informational messages as warnings. +This will result in a nonzero return code, and a higher logging level. +.RE .TP .BI \-T Print timing and memory usage information for each phase. diff --git a/scrub/common.c b/scrub/common.c index 283ac84e232..aca59648711 100644 --- a/scrub/common.c +++ b/scrub/common.c @@ -110,6 +110,8 @@ __str_out( /* print strerror or format of choice but not both */ assert(!(error && format)); + if (level == S_INFO && info_is_warning) + level = S_WARN; if (level >= S_INFO) stream = stdout; diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index 752180d646b..aa68c23c62e 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -160,6 +160,9 @@ bool is_service; /* Set to true if the kernel supports XFS_SCRUB_IFLAG_FORCE_REBUILD */ bool use_force_rebuild; +/* Should we count informational messages as warnings? */ +bool info_is_warning; + #define SCRUB_RET_SUCCESS (0) /* no problems left behind */ #define SCRUB_RET_CORRUPT (1) /* corruption remains on fs */ #define SCRUB_RET_UNOPTIMIZED (2) /* fs could be optimized */ @@ -604,6 +607,43 @@ report_outcome( # define XFS_SCRUB_HAVE_UNICODE "-" #endif +/* + * -o: user-supplied override options + */ +enum o_opt_nums { + IWARN = 0, + O_MAX_OPTS, +}; + +static char *o_opts[] = { + [IWARN] = "iwarn", + [O_MAX_OPTS] = NULL, +}; + +static void +parse_o_opts( + struct scrub_ctx *ctx, + char *p) +{ + while (*p != '\0') { + char *val; + + switch (getsubopt(&p, o_opts, &val)) { + case IWARN: + if (val) { + fprintf(stderr, + _("iwarn does not take an argument\n")); + usage(); + } + info_is_warning = true; + break; + default: + usage(); + break; + } + } +} + int main( int argc, @@ -637,7 +677,7 @@ main( pthread_mutex_init(&ctx.lock, NULL); ctx.mode = SCRUB_MODE_REPAIR; ctx.error_action = ERRORS_CONTINUE; - while ((c = getopt(argc, argv, "a:bC:de:km:nTvxV")) != EOF) { + while ((c = getopt(argc, argv, "a:bC:de:km:no:TvxV")) != EOF) { switch (c) { case 'a': ctx.max_errors = cvt_u64(optarg, 10); @@ -687,6 +727,9 @@ main( case 'n': ctx.mode = SCRUB_MODE_DRY_RUN; break; + case 'o': + parse_o_opts(&ctx, optarg); + break; case 'T': display_rusage = true; break; diff --git a/scrub/xfs_scrub.h b/scrub/xfs_scrub.h index 34d850d8db3..1151ee9ff3a 100644 --- a/scrub/xfs_scrub.h +++ b/scrub/xfs_scrub.h @@ -22,6 +22,7 @@ extern bool stderr_isatty; extern bool stdout_isatty; extern bool is_service; extern bool use_force_rebuild; +extern bool info_is_warning; enum scrub_mode { SCRUB_MODE_DRY_RUN,