linux/fs/jbd2
zhangyi (F) 597599268e jbd2: discard dirty data when forgetting an un-journalled buffer
We do not unmap and clear dirty flag when forgetting a buffer without
journal or does not belongs to any transaction, so the invalid dirty
data may still be written to the disk later. It's fine if the
corresponding block is never used before the next mount, and it's also
fine that we invoke clean_bdev_aliases() related functions to unmap
the block device mapping when re-allocating such freed block as data
block. But this logic is somewhat fragile and risky that may lead to
data corruption if we forget to clean bdev aliases. So, It's better to
discard dirty data during forget time.

We have been already handled all the cases of forgetting journalled
buffer, this patch deal with the remaining two cases.

- buffer is not journalled yet,
- buffer is journalled but doesn't belongs to any transaction.

We invoke __bforget() instead of __brelese() when forgetting an
un-journalled buffer in jbd2_journal_forget(). After this patch we can
remove all clean_bdev_aliases() related calls in ext4.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
2019-02-10 23:26:06 -05:00
..
checkpoint.c jbd2: fix deadlock while checkpoint thread waits commit thread to finish 2019-01-31 23:42:11 -05:00
commit.c jbd2: avoid long hold times of j_state_lock while committing a transaction 2018-12-03 23:16:07 -05:00
journal.c jbd2: fix deadlock while checkpoint thread waits commit thread to finish 2019-01-31 23:42:11 -05:00
Kconfig jbd2: remove debug dependency on debug_fs and update Kconfig help text 2013-06-12 23:07:51 -04:00
Makefile
recovery.c jbd2: clarify bad journal block checksum message 2018-02-18 21:33:13 -05:00
revoke.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
transaction.c jbd2: discard dirty data when forgetting an un-journalled buffer 2019-02-10 23:26:06 -05:00