linux/fs/xfs/scrub
Darrick J. Wong 71bddbccab xfs: fix scrub and remount-ro protection when running scrub
While running a new fstest that races a readonly remount with scrub
running in repair mode, I observed the kernel tripping over debugging
assertions in the log quiesce code that were checking that the CIL was
empty.  When the sysadmin runs scrub in repair mode, the scrub code
allocates real transactions (with reservations) to change things, but
doesn't increment the superblock writers count to block a readonly
remount attempt while it is running.

We don't require the userspace caller to have a writable file descriptor
to run repairs, so we have to call mnt_want_write_file to obtain freeze
protection and increment the writers count.  It's ok to remove the call
to sb_start_write for the dry-run case because commit 8321ddb2fa
removed the behavior where scrub and fsfreeze fight over the buffer LRU.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2021-04-09 10:27:13 -07:00
..
agheader_repair.c xfs: remove unneeded return value check for *init_cursor() 2020-12-09 09:49:38 -08:00
agheader.c xfs: remove return value from xchk_ag_btcur_init 2021-03-25 16:47:50 -07:00
alloc.c xfs: convert btree cursor ag-private member name 2020-03-13 10:37:14 -07:00
attr.c xfs: mark extended attr corrupt when lookup-by-hash fails 2020-03-12 07:58:13 -07:00
attr.h xfs: only allocate memory for scrubbing attributes when we need it 2019-07-05 10:29:56 -07:00
bitmap.c xfs: replace open-coded bitmap weight logic 2020-03-18 08:12:23 -07:00
bitmap.h xfs: replace open-coded bitmap weight logic 2020-03-18 08:12:23 -07:00
bmap.c xfs: remove unneeded return value check for *init_cursor() 2020-12-09 09:49:38 -08:00
btree.c xfs: scrub: Disable check for unoptimized data fork bmbt node 2021-04-07 14:37:06 -07:00
btree.h xfs: const-ify xfs_owner_info arguments 2018-12-12 08:47:16 -08:00
common.c xfs: move the di_flags field to struct xfs_inode 2021-04-07 14:37:05 -07:00
common.h xfs: remove return value from xchk_ag_btcur_init 2021-03-25 16:47:50 -07:00
dabtree.c xfs: check dabtree node hash values when loading child blocks 2020-09-23 08:58:51 -07:00
dabtree.h xfs: refactor btree node scrubbing 2019-11-10 16:54:19 -08:00
dir.c xfs: move the di_size field to struct xfs_inode 2021-04-07 14:37:03 -07:00
fscounters.c xfs: remove unnecessary null pointer checks from _read_agf callers 2020-01-26 14:32:27 -08:00
health.c xfs: mark a data structure sick if there are cross-referencing errors 2021-03-25 16:47:49 -07:00
health.h xfs: scrub should only cross-reference with healthy btrees 2019-04-16 10:01:57 -07:00
ialloc.c xfs: split xfs_imap_to_bp 2021-04-07 14:37:02 -07:00
inode.c xfs: don't catch dax+reflink inodes as corruption in verifier 2020-12-09 09:49:38 -08:00
parent.c xfs: move the di_size field to struct xfs_inode 2021-04-07 14:37:03 -07:00
quota.c xfs: fix dquot scrub loop cancellation 2021-03-25 16:47:49 -07:00
refcount.c xfs: fix brainos in the refcount scrubber's rmap fragment processor 2020-11-10 16:48:03 -08:00
repair.c xfs: fix uninitialized variables in xrep_calc_ag_resblks 2021-03-25 16:47:49 -07:00
repair.h xfs: create xfs_dqtype_t to represent quota types 2020-07-28 20:24:14 -07:00
rmap.c xfs: convert btree cursor ag-private member name 2020-03-13 10:37:14 -07:00
rtbitmap.c xfs: move the di_size field to struct xfs_inode 2021-04-07 14:37:03 -07:00
scrub.c xfs: fix scrub and remount-ro protection when running scrub 2021-04-09 10:27:13 -07:00
scrub.h xfs: fix scrub and remount-ro protection when running scrub 2021-04-09 10:27:13 -07:00
symlink.c xfs: move the di_size field to struct xfs_inode 2021-04-07 14:37:03 -07:00
trace.c xfs: convert btree cursor inode-private member names 2020-03-13 10:37:14 -07:00
trace.h xfs: convert btree cursor inode-private member names 2020-03-13 10:37:14 -07:00
xfs_scrub.h xfs: fix scrub and remount-ro protection when running scrub 2021-04-09 10:27:13 -07:00