Ye Bin aba664845a ext4: forbid commit inconsistent quota data when errors=remount-ro
[ Upstream commit d8b945fa475f13d787df00c26a6dc45a3e2e1d1d ]

There's issue as follows When do IO fault injection test:
Quota error (device dm-3): find_block_dqentry: Quota for id 101 referenced but not present
Quota error (device dm-3): qtree_read_dquot: Can't read quota structure for id 101
Quota error (device dm-3): do_check_range: Getting block 2021161007 out of range 1-186
Quota error (device dm-3): qtree_read_dquot: Can't read quota structure for id 661

Now, ext4_write_dquot()/ext4_acquire_dquot()/ext4_release_dquot() may commit
inconsistent quota data even if process failed. This may lead to filesystem
corruption.
To ensure filesystem consistent when errors=remount-ro there is need to call
ext4_handle_error() to abort journal.

Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240119062908.3598806-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:05:09 +02:00
..
2024-04-03 15:19:30 +02:00
2024-02-05 20:12:58 +00:00
2022-09-24 07:00:00 +02:00
2024-04-03 15:19:34 +02:00
2023-09-13 09:43:05 +02:00
2022-09-11 20:26:07 -07:00
2024-02-23 09:12:45 +01:00
2023-09-23 11:11:10 +02:00
2022-09-24 07:00:00 +02:00
2024-03-26 18:20:28 -04:00
2023-08-30 16:11:10 +02:00
2022-10-10 14:21:11 -07:00
2023-01-04 11:29:01 +01:00