diff options
author | Darrick J. Wong | 2021-03-22 09:51:51 -0700 |
---|---|---|
committer | Darrick J. Wong | 2021-04-09 10:27:13 -0700 |
commit | 71bddbccab436a261a22afe5d90de269941d0fe7 (patch) | |
tree | 41c7465a6ff174435ec273ff5b51a2a6b5475581 /fs/xfs/scrub/parent.c | |
parent | 7d88329e5b0fe636e63e2b1f078696bc85780442 (diff) |
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 8321ddb2fa29
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>
Diffstat (limited to 'fs/xfs/scrub/parent.c')
0 files changed, 0 insertions, 0 deletions