Merge tag 'ext4_for_linus-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 31 Aug 2023 22:18:15 +0000 (15:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 31 Aug 2023 22:18:15 +0000 (15:18 -0700)
Pull ext4 updates from Ted Ts'o:
 "Many ext4 and jbd2 cleanups and bug fixes:

   - Cleanups in the ext4 remount code when going to and from read-only

   - Cleanups in ext4's multiblock allocator

   - Cleanups in the jbd2 setup/mounting code paths

   - Performance improvements when appending to a delayed allocation file

   - Miscellaneous syzbot and other bug fixes"

* tag 'ext4_for_linus-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (60 commits)
  ext4: fix slab-use-after-free in ext4_es_insert_extent()
  libfs: remove redundant checks of s_encoding
  ext4: remove redundant checks of s_encoding
  ext4: reject casefold inode flag without casefold feature
  ext4: use LIST_HEAD() to initialize the list_head in mballoc.c
  ext4: do not mark inode dirty every time when appending using delalloc
  ext4: rename s_error_work to s_sb_upd_work
  ext4: add periodic superblock update check
  ext4: drop dio overwrite only flag and associated warning
  ext4: add correct group descriptors and reserved GDT blocks to system zone
  ext4: remove unused function declaration
  ext4: mballoc: avoid garbage value from err
  ext4: use sbi instead of EXT4_SB(sb) in ext4_mb_new_blocks_simple()
  ext4: change the type of blocksize in ext4_mb_init_cache()
  ext4: fix unttached inode after power cut with orphan file feature enabled
  jbd2: correct the end of the journal recovery scan range
  ext4: ext4_get_{dev}_journal return proper error value
  ext4: cleanup ext4_get_dev_journal() and ext4_get_journal()
  jbd2: jbd2_journal_init_{dev,inode} return proper error return value
  jbd2: drop useless error tag in jbd2_journal_wipe()
  ...

13 files changed:
1  2 
fs/ext4/ext4.h
fs/ext4/ext4_jbd2.c
fs/ext4/file.c
fs/ext4/ialloc.c
fs/ext4/inline.c
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/ext4/namei.c
fs/ext4/super.c
fs/ext4/xattr.c
fs/jbd2/journal.c
fs/libfs.c
fs/ocfs2/journal.c

diff --cc fs/ext4/ext4.h
Simple merge
Simple merge
diff --cc fs/ext4/file.c
Simple merge
Simple merge
Simple merge
diff --cc fs/ext4/inode.c
Simple merge
diff --cc fs/ext4/ioctl.c
Simple merge
diff --cc fs/ext4/namei.c
Simple merge
diff --cc fs/ext4/super.c
index 73547d2334fd7c3b605cf08b78d7a0eef5018b81,91f20afa1d71cf269f2b16666e2d26cd9cc262cc..38217422f938833f2eb9312f80da735190080dd6
@@@ -1097,26 -1156,34 +1157,6 @@@ void ext4_update_dynamic_rev(struct sup
         */
  }
  
 -static void ext4_bdev_mark_dead(struct block_device *bdev)
 -{
 -      ext4_force_shutdown(bdev->bd_holder, EXT4_GOING_FLAGS_NOLOGFLUSH);
 -}
 -
 -static const struct blk_holder_ops ext4_holder_ops = {
 -      .mark_dead              = ext4_bdev_mark_dead,
 -};
 -
--/*
-  * Open the external journal device
 - * Release the journal device
-- */
- static struct block_device *ext4_blkdev_get(dev_t dev, struct super_block *sb)
 -static void ext4_blkdev_remove(struct ext4_sb_info *sbi)
--{
--      struct block_device *bdev;
-       bdev = blkdev_get_by_dev(dev, BLK_OPEN_READ | BLK_OPEN_WRITE, sb,
-                                &fs_holder_ops);
-       if (IS_ERR(bdev))
-               goto fail;
-       return bdev;
- fail:
-       ext4_msg(sb, KERN_ERR,
-                "failed to open journal device unknown-block(%u,%u) %ld",
-                MAJOR(dev), MINOR(dev), PTR_ERR(bdev));
-       return NULL;
 -      bdev = sbi->s_journal_bdev;
 -      if (bdev) {
 -              /*
 -               * Invalidate the journal device's buffers.  We don't want them
 -               * floating about in memory - the physical journal device may
 -               * hotswapped, and it breaks the `ro-after' testing code.
 -               */
 -              invalidate_bdev(bdev);
 -              blkdev_put(bdev, sbi->s_sb);
 -              sbi->s_journal_bdev = NULL;
 -      }
--}
--
  static inline struct inode *orphan_list_entry(struct list_head *l)
  {
        return &list_entry(l, struct ext4_inode_info, i_orphan)->vfs_inode;
@@@ -5828,17 -5873,16 +5852,19 @@@ static struct block_device *ext4_get_jo
        ext4_fsblk_t sb_block;
        unsigned long offset;
        struct ext4_super_block *es;
-       struct block_device *bdev;
-       if (WARN_ON_ONCE(!ext4_has_feature_journal(sb)))
-               return NULL;
+       int errno;
  
-       bdev = ext4_blkdev_get(j_dev, sb);
 +      /* see get_tree_bdev why this is needed and safe */
 +      up_write(&sb->s_umount);
 -                               &ext4_holder_ops);
+       bdev = blkdev_get_by_dev(j_dev, BLK_OPEN_READ | BLK_OPEN_WRITE, sb,
-       if (bdev == NULL)
-               return NULL;
++                               &fs_holder_ops);
 +      down_write(&sb->s_umount);
+       if (IS_ERR(bdev)) {
+               ext4_msg(sb, KERN_ERR,
+                        "failed to open journal device unknown-block(%u,%u) %ld",
+                        MAJOR(j_dev), MINOR(j_dev), PTR_ERR(bdev));
+               return ERR_CAST(bdev);
+       }
  
        blocksize = sb->s_blocksize;
        hblock = bdev_logical_block_size(bdev);
diff --cc fs/ext4/xattr.c
Simple merge
Simple merge
diff --cc fs/libfs.c
Simple merge
Simple merge