diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-04-29 14:39:33 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-05-04 08:43:27 -0700 |
commit | 8e9800f9f2b89e1efe2a5993361fae4d618a6c26 (patch) | |
tree | ef3a24ab9e3e87873b007b5ee6f6260f66e38b7e /include/media/cec.h | |
parent | d4f74e162d238ce00a640af5f0611c3f51dad70e (diff) | |
download | linux-8e9800f9f2b89e1efe2a5993361fae4d618a6c26.tar.bz2 |
xfs: don't allow log writes if the data device is readonly
While running generic/050 with an external log, I observed this warning
in dmesg:
Trying to write to read-only block-device sda4 (partno 4)
WARNING: CPU: 2 PID: 215677 at block/blk-core.c:704 submit_bio_checks+0x256/0x510
Call Trace:
submit_bio_noacct+0x2c/0x430
_xfs_buf_ioapply+0x283/0x3c0 [xfs]
__xfs_buf_submit+0x6a/0x210 [xfs]
xfs_buf_delwri_submit_buffers+0xf8/0x270 [xfs]
xfsaild+0x2db/0xc50 [xfs]
kthread+0x14b/0x170
I think this happened because we tried to cover the log after a readonly
mount, and the AIL tried to write the primary superblock to the data
device. The test marks the data device readonly, but it doesn't do the
same to the external log device. Therefore, XFS thinks that the log is
writable, even though AIL writes whine to dmesg because the data device
is read only.
Fix this by amending xfs_log_writable to prevent writes when the AIL
can't possible write anything into the filesystem.
Note: As for the external log or the rt devices being readonly--
xfs_blkdev_get will complain about that if we aren't doing a norecovery
mount.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'include/media/cec.h')
0 files changed, 0 insertions, 0 deletions