mbox series

[RFC,v2,0/7] ext4, jbd2: fix 3 issues about bdev_try_to_free_page()

Message ID 20210414134737.2366971-1-yi.zhang@huawei.com (mailing list archive)
Headers show
Series ext4, jbd2: fix 3 issues about bdev_try_to_free_page() | expand

Message

Zhang Yi April 14, 2021, 1:47 p.m. UTC
Patch 1-2: fix a potential filesystem inconsistency problem.
Patch 3-7: fix two use after free problem.

Changes since v1:
 - Do not use j_checkpoint_mutex to fix the filesystem inconsistency
   problem, introduce a new mark instead.
 - Fix superblock use-after-free issue in blkdev_releasepage().
 - Avoid race between bdev_try_to_free_page() and ext4_put_super().

Zhang Yi (7):
  jbd2: remove the out label in __jbd2_journal_remove_checkpoint()
  jbd2: ensure abort the journal if detect IO error when writing
    original buffer back
  jbd2: don't abort the journal when freeing buffers
  jbd2: do not free buffers in jbd2_journal_try_to_free_buffers()
  ext4: use RCU to protect accessing superblock in blkdev_releasepage()
  fs: introduce a usage count into the superblock
  ext4: fix race between blkdev_releasepage() and ext4_put_super()

 fs/block_dev.c        | 13 ++++++----
 fs/ext4/inode.c       |  6 +++--
 fs/ext4/super.c       | 32 +++++++++++++++++++++----
 fs/jbd2/checkpoint.c  | 56 ++++++++++++++++++++++++-------------------
 fs/jbd2/journal.c     |  9 +++++++
 fs/jbd2/transaction.c | 32 ++++++-------------------
 include/linux/fs.h    | 29 ++++++++++++++++++++++
 include/linux/jbd2.h  |  7 ++++++
 8 files changed, 123 insertions(+), 61 deletions(-)