]> Git Repo - J-linux.git/commitdiff
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
authorLinus Torvalds <[email protected]>
Thu, 11 Nov 2021 01:05:37 +0000 (17:05 -0800)
committerLinus Torvalds <[email protected]>
Thu, 11 Nov 2021 01:05:37 +0000 (17:05 -0800)
Pull ext4 updates from Ted Ts'o:
 "Only bug fixes and cleanups for ext4 this merge window.

  Of note are fixes for the combination of the inline_data and
  fast_commit fixes, and more accurately calculating when to schedule
  additional lazy inode table init, especially when CONFIG_HZ is 100HZ"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix error code saved on super block during file system abort
  ext4: inline data inode fast commit replay fixes
  ext4: commit inline data during fast commit
  ext4: scope ret locally in ext4_try_to_trim_range()
  ext4: remove an unused variable warning with CONFIG_QUOTA=n
  ext4: fix boolreturn.cocci warnings in fs/ext4/name.c
  ext4: prevent getting empty inode buffer
  ext4: move ext4_fill_raw_inode() related functions
  ext4: factor out ext4_fill_raw_inode()
  ext4: prevent partial update of the extent blocks
  ext4: check for inconsistent extents between index and leaf block
  ext4: check for out-of-order index extents in ext4_valid_extent_entries()
  ext4: convert from atomic_t to refcount_t on ext4_io_end->count
  ext4: refresh the ext4_ext_path struct after dropping i_data_sem.
  ext4: ensure enough credits in ext4_ext_shift_path_extents
  ext4: correct the left/middle/right debug message for binsearch
  ext4: fix lazy initialization next schedule time computation in more granular unit
  Revert "ext4: enforce buffer head state assertion in ext4_da_map_blocks"

1  2 
fs/ext4/super.c

diff --combined fs/ext4/super.c
index a320c54202d95e0ee56c1daf571d0896c7821e69,0e8406f5bf0aa0c1c0755c160d24455f676b9fe2..4e33b5eca694db9eeb919c3d85d95235b5839eea
@@@ -46,7 -46,6 +46,7 @@@
  #include <linux/part_stat.h>
  #include <linux/kthread.h>
  #include <linux/freezer.h>
 +#include <linux/fsnotify.h>
  
  #include "ext4.h"
  #include "ext4_extents.h"     /* Needed for trace points definition */
@@@ -760,8 -759,6 +760,8 @@@ void __ext4_error(struct super_block *s
                       sb->s_id, function, line, current->comm, &vaf);
                va_end(args);
        }
 +      fsnotify_sb_error(sb, NULL, error ? error : EFSCORRUPTED);
 +
        ext4_handle_error(sb, force_ro, error, 0, block, function, line);
  }
  
@@@ -792,8 -789,6 +792,8 @@@ void __ext4_error_inode(struct inode *i
                               current->comm, &vaf);
                va_end(args);
        }
 +      fsnotify_sb_error(inode->i_sb, inode, error ? error : EFSCORRUPTED);
 +
        ext4_handle_error(inode->i_sb, false, error, inode->i_ino, block,
                          function, line);
  }
@@@ -832,8 -827,6 +832,8 @@@ void __ext4_error_file(struct file *fil
                               current->comm, path, &vaf);
                va_end(args);
        }
 +      fsnotify_sb_error(inode->i_sb, inode, EFSCORRUPTED);
 +
        ext4_handle_error(inode->i_sb, false, EFSCORRUPTED, inode->i_ino, block,
                          function, line);
  }
@@@ -901,7 -894,6 +901,7 @@@ void __ext4_std_error(struct super_bloc
                printk(KERN_CRIT "EXT4-fs error (device %s) in %s:%d: %s\n",
                       sb->s_id, function, line, errstr);
        }
 +      fsnotify_sb_error(sb, NULL, errno ? errno : EFSCORRUPTED);
  
        ext4_handle_error(sb, false, -errno, 0, 0, function, line);
  }
@@@ -1580,6 -1572,7 +1580,6 @@@ static const struct fscrypt_operations 
        .set_context            = ext4_set_context,
        .get_dummy_policy       = ext4_get_dummy_policy,
        .empty_dir              = ext4_empty_dir,
 -      .max_namelen            = EXT4_NAME_LEN,
        .has_stable_inodes      = ext4_has_stable_inodes,
        .get_ino_and_lblk_bits  = ext4_get_ino_and_lblk_bits,
  };
@@@ -3270,9 -3263,9 +3270,9 @@@ static int ext4_run_li_request(struct e
        struct super_block *sb = elr->lr_super;
        ext4_group_t ngroups = EXT4_SB(sb)->s_groups_count;
        ext4_group_t group = elr->lr_next_group;
-       unsigned long timeout = 0;
        unsigned int prefetch_ios = 0;
        int ret = 0;
+       u64 start_time;
  
        if (elr->lr_mode == EXT4_LI_MODE_PREFETCH_BBITMAP) {
                elr->lr_next_group = ext4_mb_prefetch(sb, group,
                ret = 1;
  
        if (!ret) {
-               timeout = jiffies;
+               start_time = ktime_get_real_ns();
                ret = ext4_init_inode_table(sb, group,
                                            elr->lr_timeout ? 0 : 1);
                trace_ext4_lazy_itable_init(sb, group);
                if (elr->lr_timeout == 0) {
-                       timeout = (jiffies - timeout) *
-                               EXT4_SB(elr->lr_super)->s_li_wait_mult;
-                       elr->lr_timeout = timeout;
+                       elr->lr_timeout = nsecs_to_jiffies((ktime_get_real_ns() - start_time) *
+                               EXT4_SB(elr->lr_super)->s_li_wait_mult);
                }
                elr->lr_next_sched = jiffies + elr->lr_timeout;
                elr->lr_next_group = group + 1;
@@@ -4481,7 -4473,7 +4480,7 @@@ static int ext4_fill_super(struct super
                goto cantfind_ext4;
  
        /* check blocks count against device size */
 -      blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
 +      blocks_count = sb_bdev_nr_blocks(sb);
        if (blocks_count && ext4_blocks_count(es) > blocks_count) {
                ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu "
                       "exceeds size of device (%llu blocks)",
@@@ -5734,10 -5726,10 +5733,10 @@@ static int ext4_remount(struct super_bl
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        unsigned long old_sb_flags, vfs_flags;
        struct ext4_mount_options old_opts;
-       int enable_quota = 0;
        ext4_group_t g;
        int err = 0;
  #ifdef CONFIG_QUOTA
+       int enable_quota = 0;
        int i, j;
        char *to_free[EXT4_MAXQUOTAS];
  #endif
        }
  
        if (ext4_test_mount_flag(sb, EXT4_MF_FS_ABORTED))
-               ext4_abort(sb, EXT4_ERR_ESHUTDOWN, "Abort forced by user");
+               ext4_abort(sb, ESHUTDOWN, "Abort forced by user");
  
        sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
                (test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
                                        err = -EROFS;
                                        goto restore_opts;
                                }
+ #ifdef CONFIG_QUOTA
                        enable_quota = 1;
+ #endif
                }
        }
  
This page took 0.089881 seconds and 4 git commands to generate.