Lines Matching full:sb
70 static void ext4_update_super(struct super_block *sb);
71 static int ext4_commit_super(struct super_block *sb);
72 static int ext4_mark_recovery_complete(struct super_block *sb,
74 static int ext4_clear_journal_err(struct super_block *sb,
76 static int ext4_sync_fs(struct super_block *sb, int wait);
78 static int ext4_unfreeze(struct super_block *sb);
79 static int ext4_freeze(struct super_block *sb);
80 static inline int ext2_feature_set_ok(struct super_block *sb);
81 static inline int ext3_feature_set_ok(struct super_block *sb);
83 static void ext4_unregister_li_request(struct super_block *sb);
85 static struct inode *ext4_get_journal_inode(struct super_block *sb,
89 struct super_block *sb);
90 static void ext4_apply_options(struct fs_context *fc, struct super_block *sb);
96 static void ext4_kill_sb(struct super_block *sb);
144 #define IS_EXT2_SB(sb) ((sb)->s_type == &ext2_fs_type) argument
146 #define IS_EXT2_SB(sb) (0) argument
160 #define IS_EXT3_SB(sb) ((sb)->s_type == &ext3_fs_type) argument
223 static struct buffer_head *__ext4_sb_bread_gfp(struct super_block *sb, in __ext4_sb_bread_gfp() argument
230 bh = sb_getblk_gfp(sb, block, gfp); in __ext4_sb_bread_gfp()
244 struct buffer_head *ext4_sb_bread(struct super_block *sb, sector_t block, in ext4_sb_bread() argument
247 gfp_t gfp = mapping_gfp_constraint(sb->s_bdev->bd_mapping, in ext4_sb_bread()
250 return __ext4_sb_bread_gfp(sb, block, op_flags, gfp); in ext4_sb_bread()
253 struct buffer_head *ext4_sb_bread_unmovable(struct super_block *sb, in ext4_sb_bread_unmovable() argument
256 gfp_t gfp = mapping_gfp_constraint(sb->s_bdev->bd_mapping, in ext4_sb_bread_unmovable()
259 return __ext4_sb_bread_gfp(sb, block, 0, gfp); in ext4_sb_bread_unmovable()
262 void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block) in ext4_sb_breadahead_unmovable() argument
264 struct buffer_head *bh = bdev_getblk(sb->s_bdev, block, in ext4_sb_breadahead_unmovable()
265 sb->s_blocksize, GFP_NOWAIT | __GFP_NOWARN); in ext4_sb_breadahead_unmovable()
274 static int ext4_verify_csum_type(struct super_block *sb, in ext4_verify_csum_type() argument
277 if (!ext4_has_feature_metadata_csum(sb)) in ext4_verify_csum_type()
283 __le32 ext4_superblock_csum(struct super_block *sb, in ext4_superblock_csum() argument
286 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_superblock_csum()
295 static int ext4_superblock_csum_verify(struct super_block *sb, in ext4_superblock_csum_verify() argument
298 if (!ext4_has_metadata_csum(sb)) in ext4_superblock_csum_verify()
301 return es->s_checksum == ext4_superblock_csum(sb, es); in ext4_superblock_csum_verify()
304 void ext4_superblock_csum_set(struct super_block *sb) in ext4_superblock_csum_set() argument
306 struct ext4_super_block *es = EXT4_SB(sb)->s_es; in ext4_superblock_csum_set()
308 if (!ext4_has_metadata_csum(sb)) in ext4_superblock_csum_set()
311 es->s_checksum = ext4_superblock_csum(sb, es); in ext4_superblock_csum_set()
314 ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, in ext4_block_bitmap() argument
318 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_block_bitmap()
322 ext4_fsblk_t ext4_inode_bitmap(struct super_block *sb, in ext4_inode_bitmap() argument
326 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_inode_bitmap()
330 ext4_fsblk_t ext4_inode_table(struct super_block *sb, in ext4_inode_table() argument
334 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_inode_table()
338 __u32 ext4_free_group_clusters(struct super_block *sb, in ext4_free_group_clusters() argument
342 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_free_group_clusters()
346 __u32 ext4_free_inodes_count(struct super_block *sb, in ext4_free_inodes_count() argument
350 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_free_inodes_count()
354 __u32 ext4_used_dirs_count(struct super_block *sb, in ext4_used_dirs_count() argument
358 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_used_dirs_count()
362 __u32 ext4_itable_unused_count(struct super_block *sb, in ext4_itable_unused_count() argument
366 (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? in ext4_itable_unused_count()
370 void ext4_block_bitmap_set(struct super_block *sb, in ext4_block_bitmap_set() argument
374 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_block_bitmap_set()
378 void ext4_inode_bitmap_set(struct super_block *sb, in ext4_inode_bitmap_set() argument
382 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_inode_bitmap_set()
386 void ext4_inode_table_set(struct super_block *sb, in ext4_inode_table_set() argument
390 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_inode_table_set()
394 void ext4_free_group_clusters_set(struct super_block *sb, in ext4_free_group_clusters_set() argument
398 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_free_group_clusters_set()
402 void ext4_free_inodes_set(struct super_block *sb, in ext4_free_inodes_set() argument
406 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_free_inodes_set()
410 void ext4_used_dirs_set(struct super_block *sb, in ext4_used_dirs_set() argument
414 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_used_dirs_set()
418 void ext4_itable_unused_set(struct super_block *sb, in ext4_itable_unused_set() argument
422 if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) in ext4_itable_unused_set()
457 * @sb: The superblock
459 static void ext4_maybe_update_superblock(struct super_block *sb) in ext4_maybe_update_superblock() argument
461 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_maybe_update_superblock()
469 if (sb_rdonly(sb) || !(sb->s_flags & SB_ACTIVE) || in ext4_maybe_update_superblock()
480 ((part_stat_read(sb->s_bdev, sectors[STAT_WRITE]) - in ext4_maybe_update_superblock()
492 schedule_work(&EXT4_SB(sb)->s_sb_upd_work); in ext4_maybe_update_superblock()
497 struct super_block *sb = journal->j_private; in ext4_journal_commit_callback() local
498 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_journal_commit_callback()
504 ext4_process_freed_data(sb, txn->t_tid); in ext4_journal_commit_callback()
505 ext4_maybe_update_superblock(sb); in ext4_journal_commit_callback()
513 jce->jce_func(sb, jce, error); in ext4_journal_commit_callback()
643 static void save_error_info(struct super_block *sb, int error, in save_error_info() argument
647 struct ext4_sb_info *sbi = EXT4_SB(sb); in save_error_info()
692 static void ext4_handle_error(struct super_block *sb, bool force_ro, int error, in ext4_handle_error() argument
696 journal_t *journal = EXT4_SB(sb)->s_journal; in ext4_handle_error()
697 bool continue_fs = !force_ro && test_opt(sb, ERRORS_CONT); in ext4_handle_error()
699 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; in ext4_handle_error()
700 if (test_opt(sb, WARN_ON_ERROR)) in ext4_handle_error()
703 if (!continue_fs && !sb_rdonly(sb)) { in ext4_handle_error()
704 set_bit(EXT4_FLAGS_SHUTDOWN, &EXT4_SB(sb)->s_ext4_flags); in ext4_handle_error()
709 if (!bdev_read_only(sb->s_bdev)) { in ext4_handle_error()
710 save_error_info(sb, error, ino, block, func, line); in ext4_handle_error()
718 schedule_work(&EXT4_SB(sb)->s_sb_upd_work); in ext4_handle_error()
720 ext4_commit_super(sb); in ext4_handle_error()
728 if (test_opt(sb, ERRORS_PANIC) && !system_going_down()) { in ext4_handle_error()
730 sb->s_id); in ext4_handle_error()
733 if (sb_rdonly(sb) || continue_fs) in ext4_handle_error()
736 ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only"); in ext4_handle_error()
740 * sb->s_umount semaphore and setting it without proper remount in ext4_handle_error()
755 * through the journal to avoid collisions of other journalled sb in update_super_work()
797 * Write through journal failed. Write sb directly to get error info in update_super_work()
804 #define ext4_error_ratelimit(sb) \ argument
805 ___ratelimit(&(EXT4_SB(sb)->s_err_ratelimit_state), \
808 void __ext4_error(struct super_block *sb, const char *function, in __ext4_error() argument
815 if (unlikely(ext4_forced_shutdown(sb))) in __ext4_error()
818 trace_ext4_error(sb, function, line); in __ext4_error()
819 if (ext4_error_ratelimit(sb)) { in __ext4_error()
825 sb->s_id, function, line, current->comm, &vaf); in __ext4_error()
828 fsnotify_sb_error(sb, NULL, error ? error : EFSCORRUPTED); in __ext4_error()
830 ext4_handle_error(sb, force_ro, error, 0, block, function, line); in __ext4_error()
906 const char *ext4_decode_error(struct super_block *sb, int errno, in ext4_decode_error() argument
925 if (!sb || (EXT4_SB(sb)->s_journal && in ext4_decode_error()
926 EXT4_SB(sb)->s_journal->j_flags & JBD2_ABORT)) in ext4_decode_error()
949 void __ext4_std_error(struct super_block *sb, const char *function, in __ext4_std_error() argument
955 if (unlikely(ext4_forced_shutdown(sb))) in __ext4_std_error()
961 if (errno == -EROFS && journal_current_handle() == NULL && sb_rdonly(sb)) in __ext4_std_error()
964 if (ext4_error_ratelimit(sb)) { in __ext4_std_error()
965 errstr = ext4_decode_error(sb, errno, nbuf); in __ext4_std_error()
967 sb->s_id, function, line, errstr); in __ext4_std_error()
969 fsnotify_sb_error(sb, NULL, errno ? errno : EFSCORRUPTED); in __ext4_std_error()
971 ext4_handle_error(sb, false, -errno, 0, 0, function, line); in __ext4_std_error()
974 void __ext4_msg(struct super_block *sb, in __ext4_msg() argument
980 if (sb) { in __ext4_msg()
981 atomic_inc(&EXT4_SB(sb)->s_msg_count); in __ext4_msg()
982 if (!___ratelimit(&(EXT4_SB(sb)->s_msg_ratelimit_state), in __ext4_msg()
990 if (sb) in __ext4_msg()
991 printk("%sEXT4-fs (%s): %pV\n", prefix, sb->s_id, &vaf); in __ext4_msg()
997 static int ext4_warning_ratelimit(struct super_block *sb) in ext4_warning_ratelimit() argument
999 atomic_inc(&EXT4_SB(sb)->s_warning_count); in ext4_warning_ratelimit()
1000 return ___ratelimit(&(EXT4_SB(sb)->s_warning_ratelimit_state), in ext4_warning_ratelimit()
1004 void __ext4_warning(struct super_block *sb, const char *function, in __ext4_warning() argument
1010 if (!ext4_warning_ratelimit(sb)) in __ext4_warning()
1017 sb->s_id, function, line, &vaf); in __ext4_warning()
1040 struct super_block *sb, ext4_group_t grp, in __ext4_grp_locked_error() argument
1049 if (unlikely(ext4_forced_shutdown(sb))) in __ext4_grp_locked_error()
1052 trace_ext4_error(sb, function, line); in __ext4_grp_locked_error()
1053 if (ext4_error_ratelimit(sb)) { in __ext4_grp_locked_error()
1058 sb->s_id, function, line, grp); in __ext4_grp_locked_error()
1068 if (test_opt(sb, ERRORS_CONT)) { in __ext4_grp_locked_error()
1069 if (test_opt(sb, WARN_ON_ERROR)) in __ext4_grp_locked_error()
1071 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; in __ext4_grp_locked_error()
1072 if (!bdev_read_only(sb->s_bdev)) { in __ext4_grp_locked_error()
1073 save_error_info(sb, EFSCORRUPTED, ino, block, function, in __ext4_grp_locked_error()
1075 schedule_work(&EXT4_SB(sb)->s_sb_upd_work); in __ext4_grp_locked_error()
1079 ext4_unlock_group(sb, grp); in __ext4_grp_locked_error()
1080 ext4_handle_error(sb, false, EFSCORRUPTED, ino, block, function, line); in __ext4_grp_locked_error()
1092 ext4_lock_group(sb, grp); in __ext4_grp_locked_error()
1096 void ext4_mark_group_bitmap_corrupted(struct super_block *sb, in ext4_mark_group_bitmap_corrupted() argument
1100 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_mark_group_bitmap_corrupted()
1101 struct ext4_group_info *grp = ext4_get_group_info(sb, group); in ext4_mark_group_bitmap_corrupted()
1102 struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, NULL); in ext4_mark_group_bitmap_corrupted()
1121 count = ext4_free_inodes_count(sb, gdp); in ext4_mark_group_bitmap_corrupted()
1128 void ext4_update_dynamic_rev(struct super_block *sb) in ext4_update_dynamic_rev() argument
1130 struct ext4_super_block *es = EXT4_SB(sb)->s_es; in ext4_update_dynamic_rev()
1135 ext4_warning(sb, in ext4_update_dynamic_rev()
1158 static void dump_orphan_list(struct super_block *sb, struct ext4_sb_info *sbi) in dump_orphan_list() argument
1162 ext4_msg(sb, KERN_ERR, "sb orphan head is %d", in dump_orphan_list()
1177 static int ext4_quota_off(struct super_block *sb, int type);
1179 static inline void ext4_quotas_off(struct super_block *sb, int type) in ext4_quotas_off() argument
1185 ext4_quota_off(sb, type); in ext4_quotas_off()
1192 static inline char *get_qf_name(struct super_block *sb, in get_qf_name() argument
1197 lockdep_is_held(&sb->s_umount)); in get_qf_name()
1200 static inline void ext4_quotas_off(struct super_block *sb, int type) in ext4_quotas_off() argument
1276 static void ext4_put_super(struct super_block *sb) in ext4_put_super() argument
1278 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_put_super()
1293 ext4_unregister_sysfs(sb); in ext4_put_super()
1296 ext4_msg(sb, KERN_INFO, "unmounting filesystem %pU.", in ext4_put_super()
1297 &sb->s_uuid); in ext4_put_super()
1299 ext4_unregister_li_request(sb); in ext4_put_super()
1300 ext4_quotas_off(sb, EXT4_MAXQUOTAS); in ext4_put_super()
1304 ext4_release_orphan_info(sb); in ext4_put_super()
1311 ext4_abort(sb, -err, "Couldn't clean up the journal"); in ext4_put_super()
1317 ext4_release_system_zone(sb); in ext4_put_super()
1318 ext4_mb_release(sb); in ext4_put_super()
1319 ext4_ext_release(sb); in ext4_put_super()
1321 if (!sb_rdonly(sb) && !aborted) { in ext4_put_super()
1322 ext4_clear_feature_journal_needs_recovery(sb); in ext4_put_super()
1323 ext4_clear_feature_orphan_present(sb); in ext4_put_super()
1326 if (!sb_rdonly(sb)) in ext4_put_super()
1327 ext4_commit_super(sb); in ext4_put_super()
1337 kfree(get_qf_name(sb, sbi, i)); in ext4_put_super()
1345 dump_orphan_list(sb, sbi); in ext4_put_super()
1348 sync_blockdev(sb->s_bdev); in ext4_put_super()
1349 invalidate_bdev(sb->s_bdev); in ext4_put_super()
1369 sb->s_fs_info = NULL; in ext4_put_super()
1382 utf8_unload(sb->s_encoding); in ext4_put_super()
1392 static struct inode *ext4_alloc_inode(struct super_block *sb) in ext4_alloc_inode() argument
1396 ei = alloc_inode_sb(sb, ext4_inode_cachep, GFP_NOFS); in ext4_alloc_inode()
1472 static void ext4_shutdown(struct super_block *sb) in ext4_shutdown() argument
1474 ext4_force_shutdown(sb, EXT4_GOING_FLAGS_NOLOGFLUSH); in ext4_shutdown()
1529 static struct inode *ext4_nfs_get_inode(struct super_block *sb, in ext4_nfs_get_inode() argument
1538 inode = ext4_iget(sb, ino, EXT4_IGET_HANDLE); in ext4_nfs_get_inode()
1549 static struct dentry *ext4_fh_to_dentry(struct super_block *sb, struct fid *fid, in ext4_fh_to_dentry() argument
1552 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in ext4_fh_to_dentry()
1556 static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid, in ext4_fh_to_parent() argument
1559 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in ext4_fh_to_parent()
1581 static int ext4_write_info(struct super_block *sb, int type);
1582 static int ext4_quota_on(struct super_block *sb, int type, int format_id,
1584 static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
1586 static ssize_t ext4_quota_write(struct super_block *sb, int type,
1588 static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
1731 fsparam_u32 ("sb", Opt_sb),
2470 static int parse_apply_sb_mount_options(struct super_block *sb, in parse_apply_sb_mount_options() argument
2473 struct ext4_sb_info *sbi = EXT4_SB(sb); in parse_apply_sb_mount_options()
2503 ret = ext4_check_opt_consistency(fc, sb); in parse_apply_sb_mount_options()
2506 ext4_msg(sb, KERN_WARNING, in parse_apply_sb_mount_options()
2518 ext4_apply_options(fc, sb); in parse_apply_sb_mount_options()
2531 struct super_block *sb) in ext4_apply_quota_options() argument
2534 bool quota_feature = ext4_has_feature_quota(sb); in ext4_apply_quota_options()
2536 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_apply_quota_options()
2550 set_opt(sb, QUOTA); in ext4_apply_quota_options()
2553 lockdep_is_held(&sb->s_umount)); in ext4_apply_quota_options()
2568 struct super_block *sb) in ext4_check_quota_consistency() argument
2572 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_check_quota_consistency()
2573 bool quota_feature = ext4_has_feature_quota(sb); in ext4_check_quota_consistency()
2574 bool quota_loaded = sb_any_quota_loaded(sb); in ext4_check_quota_consistency()
2584 !ext4_has_feature_project(sb)) { in ext4_check_quota_consistency()
2608 strcmp(get_qf_name(sb, sbi, i), in ext4_check_quota_consistency()
2632 usr_qf_name = (get_qf_name(sb, sbi, USRQUOTA) || in ext4_check_quota_consistency()
2634 grp_qf_name = (get_qf_name(sb, sbi, GRPQUOTA) || in ext4_check_quota_consistency()
2638 test_opt(sb, USRQUOTA)); in ext4_check_quota_consistency()
2641 test_opt(sb, GRPQUOTA)); in ext4_check_quota_consistency()
2686 struct super_block *sb) in ext4_check_test_dummy_encryption() argument
2689 const struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_check_test_dummy_encryption()
2694 if (!ext4_has_feature_encrypt(sb)) { in ext4_check_test_dummy_encryption()
2726 struct super_block *sb) in ext4_apply_test_dummy_encryption() argument
2730 fscrypt_is_dummy_policy_set(&EXT4_SB(sb)->s_dummy_enc_policy)) in ext4_apply_test_dummy_encryption()
2732 EXT4_SB(sb)->s_dummy_enc_policy = ctx->dummy_enc_policy; in ext4_apply_test_dummy_encryption()
2734 ext4_msg(sb, KERN_WARNING, "Test dummy encryption mode enabled"); in ext4_apply_test_dummy_encryption()
2738 struct super_block *sb) in ext4_check_opt_consistency() argument
2745 if ((ctx->opt_flags & MOPT_NO_EXT2) && IS_EXT2_SB(sb)) { in ext4_check_opt_consistency()
2750 if ((ctx->opt_flags & MOPT_NO_EXT3) && IS_EXT3_SB(sb)) { in ext4_check_opt_consistency()
2764 err = ext4_check_test_dummy_encryption(fc, sb); in ext4_check_opt_consistency()
2775 test_opt(sb, DATA_FLAGS)) { in ext4_check_opt_consistency()
2784 (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)) { in ext4_check_opt_consistency()
2809 return ext4_check_quota_consistency(fc, sb); in ext4_check_opt_consistency()
2812 static void ext4_apply_options(struct fs_context *fc, struct super_block *sb) in ext4_apply_options() argument
2821 sb->s_flags &= ~ctx->mask_s_flags; in ext4_apply_options()
2822 sb->s_flags |= ctx->vals_s_flags; in ext4_apply_options()
2840 ext4_apply_quota_options(fc, sb); in ext4_apply_options()
2841 ext4_apply_test_dummy_encryption(ctx, sb); in ext4_apply_options()
2873 struct super_block *sb) in ext4_show_quota_options() argument
2876 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_show_quota_options()
2920 * - if the per-sb default is different from the global default
2922 static int _ext4_show_options(struct seq_file *seq, struct super_block *sb, in _ext4_show_options() argument
2925 struct ext4_sb_info *sbi = EXT4_SB(sb); in _ext4_show_options()
2935 SEQ_OPTS_PRINT("sb=%llu", sbi->s_sb_block); in _ext4_show_options()
2973 if (test_opt(sb, ERRORS_RO) && def_errors != EXT4_ERRORS_RO) in _ext4_show_options()
2975 if (test_opt(sb, ERRORS_CONT) && def_errors != EXT4_ERRORS_CONTINUE) in _ext4_show_options()
2977 if (test_opt(sb, ERRORS_PANIC) && def_errors != EXT4_ERRORS_PANIC) in _ext4_show_options()
2989 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) in _ext4_show_options()
2991 else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) in _ext4_show_options()
2993 else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) in _ext4_show_options()
3001 if (test_opt(sb, INIT_INODE_TABLE) && (nodefs || in _ext4_show_options()
3006 if (test_opt(sb, DATA_ERR_ABORT)) in _ext4_show_options()
3009 fscrypt_show_test_dummy_encryption(seq, sep, sb); in _ext4_show_options()
3011 if (sb->s_flags & SB_INLINECRYPT) in _ext4_show_options()
3014 if (test_opt(sb, DAX_ALWAYS)) { in _ext4_show_options()
3015 if (IS_EXT2_SB(sb)) in _ext4_show_options()
3019 } else if (test_opt2(sb, DAX_NEVER)) { in _ext4_show_options()
3021 } else if (test_opt2(sb, DAX_INODE)) { in _ext4_show_options()
3026 !test_opt2(sb, MB_OPTIMIZE_SCAN)) { in _ext4_show_options()
3029 test_opt2(sb, MB_OPTIMIZE_SCAN)) { in _ext4_show_options()
3033 ext4_show_quota_options(seq, sb); in _ext4_show_options()
3044 struct super_block *sb = seq->private; in ext4_seq_options_show() local
3047 seq_puts(seq, sb_rdonly(sb) ? "ro" : "rw"); in ext4_seq_options_show()
3048 rc = _ext4_show_options(seq, sb, 1); in ext4_seq_options_show()
3053 static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, in ext4_setup_super() argument
3056 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_setup_super()
3060 ext4_msg(sb, KERN_ERR, "revision level too high, " in ext4_setup_super()
3068 ext4_msg(sb, KERN_WARNING, "warning: mounting unchecked fs, " in ext4_setup_super()
3071 ext4_msg(sb, KERN_WARNING, in ext4_setup_super()
3077 ext4_msg(sb, KERN_WARNING, in ext4_setup_super()
3083 ext4_msg(sb, KERN_WARNING, in ext4_setup_super()
3093 ext4_set_feature_journal_needs_recovery(sb); in ext4_setup_super()
3094 if (ext4_has_feature_orphan_file(sb)) in ext4_setup_super()
3095 ext4_set_feature_orphan_present(sb); in ext4_setup_super()
3098 err = ext4_commit_super(sb); in ext4_setup_super()
3100 if (test_opt(sb, DEBUG)) in ext4_setup_super()
3103 sb->s_blocksize, in ext4_setup_super()
3105 EXT4_BLOCKS_PER_GROUP(sb), in ext4_setup_super()
3106 EXT4_INODES_PER_GROUP(sb), in ext4_setup_super()
3111 int ext4_alloc_flex_bg_array(struct super_block *sb, ext4_group_t ngroup) in ext4_alloc_flex_bg_array() argument
3113 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_alloc_flex_bg_array()
3127 ext4_msg(sb, KERN_ERR, in ext4_alloc_flex_bg_array()
3139 ext4_msg(sb, KERN_ERR, in ext4_alloc_flex_bg_array()
3158 static int ext4_fill_flex_info(struct super_block *sb) in ext4_fill_flex_info() argument
3160 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_fill_flex_info()
3172 err = ext4_alloc_flex_bg_array(sb, sbi->s_groups_count); in ext4_fill_flex_info()
3177 gdp = ext4_get_group_desc(sb, i, NULL); in ext4_fill_flex_info()
3181 atomic_add(ext4_free_inodes_count(sb, gdp), &fg->free_inodes); in ext4_fill_flex_info()
3182 atomic64_add(ext4_free_group_clusters(sb, gdp), in ext4_fill_flex_info()
3184 atomic_add(ext4_used_dirs_count(sb, gdp), &fg->used_dirs); in ext4_fill_flex_info()
3192 static __le16 ext4_group_desc_csum(struct super_block *sb, __u32 block_group, in ext4_group_desc_csum() argument
3198 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_group_desc_csum()
3220 if (!ext4_has_feature_gdt_csum(sb)) in ext4_group_desc_csum()
3228 if (ext4_has_feature_64bit(sb) && offset < sbi->s_desc_size) in ext4_group_desc_csum()
3236 int ext4_group_desc_csum_verify(struct super_block *sb, __u32 block_group, in ext4_group_desc_csum_verify() argument
3239 if (ext4_has_group_desc_csum(sb) && in ext4_group_desc_csum_verify()
3240 (gdp->bg_checksum != ext4_group_desc_csum(sb, block_group, gdp))) in ext4_group_desc_csum_verify()
3246 void ext4_group_desc_csum_set(struct super_block *sb, __u32 block_group, in ext4_group_desc_csum_set() argument
3249 if (!ext4_has_group_desc_csum(sb)) in ext4_group_desc_csum_set()
3251 gdp->bg_checksum = ext4_group_desc_csum(sb, block_group, gdp); in ext4_group_desc_csum_set()
3255 static int ext4_check_descriptors(struct super_block *sb, in ext4_check_descriptors() argument
3259 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_check_descriptors()
3262 ext4_fsblk_t last_bg_block = sb_block + ext4_bg_num_gdb(sb, 0); in ext4_check_descriptors()
3269 if (ext4_has_feature_flex_bg(sb)) in ext4_check_descriptors()
3275 struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL); in ext4_check_descriptors()
3281 (EXT4_BLOCKS_PER_GROUP(sb) - 1); in ext4_check_descriptors()
3287 block_bitmap = ext4_block_bitmap(sb, gdp); in ext4_check_descriptors()
3289 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3292 if (!sb_rdonly(sb)) in ext4_check_descriptors()
3297 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3300 if (!sb_rdonly(sb)) in ext4_check_descriptors()
3304 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3309 inode_bitmap = ext4_inode_bitmap(sb, gdp); in ext4_check_descriptors()
3311 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3314 if (!sb_rdonly(sb)) in ext4_check_descriptors()
3319 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3322 if (!sb_rdonly(sb)) in ext4_check_descriptors()
3326 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3331 inode_table = ext4_inode_table(sb, gdp); in ext4_check_descriptors()
3333 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3336 if (!sb_rdonly(sb)) in ext4_check_descriptors()
3341 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3344 if (!sb_rdonly(sb)) in ext4_check_descriptors()
3349 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3354 ext4_lock_group(sb, i); in ext4_check_descriptors()
3355 if (!ext4_group_desc_csum_verify(sb, i, gdp)) { in ext4_check_descriptors()
3356 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " in ext4_check_descriptors()
3358 i, le16_to_cpu(ext4_group_desc_csum(sb, i, in ext4_check_descriptors()
3360 if (!sb_rdonly(sb)) { in ext4_check_descriptors()
3361 ext4_unlock_group(sb, i); in ext4_check_descriptors()
3365 ext4_unlock_group(sb, i); in ext4_check_descriptors()
3367 first_block += EXT4_BLOCKS_PER_GROUP(sb); in ext4_check_descriptors()
3498 static ext4_fsblk_t descriptor_loc(struct super_block *sb, in descriptor_loc() argument
3501 struct ext4_sb_info *sbi = EXT4_SB(sb); in descriptor_loc()
3507 if (!ext4_has_feature_meta_bg(sb) || nr < first_meta_bg) in descriptor_loc()
3510 if (ext4_bg_has_super(sb, bg)) in descriptor_loc()
3519 if (sb->s_blocksize == 1024 && nr == 0 && in descriptor_loc()
3523 return (has_super + ext4_group_first_block_no(sb, bg)); in descriptor_loc()
3569 int ext4_feature_set_ok(struct super_block *sb, int readonly) in ext4_feature_set_ok() argument
3571 if (ext4_has_unknown_ext4_incompat_features(sb)) { in ext4_feature_set_ok()
3572 ext4_msg(sb, KERN_ERR, in ext4_feature_set_ok()
3575 (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_incompat) & in ext4_feature_set_ok()
3580 if (!IS_ENABLED(CONFIG_UNICODE) && ext4_has_feature_casefold(sb)) { in ext4_feature_set_ok()
3581 ext4_msg(sb, KERN_ERR, in ext4_feature_set_ok()
3590 if (ext4_has_feature_readonly(sb)) { in ext4_feature_set_ok()
3591 ext4_msg(sb, KERN_INFO, "filesystem is read-only"); in ext4_feature_set_ok()
3592 sb->s_flags |= SB_RDONLY; in ext4_feature_set_ok()
3597 if (ext4_has_unknown_ext4_ro_compat_features(sb)) { in ext4_feature_set_ok()
3598 ext4_msg(sb, KERN_ERR, "couldn't mount RDWR because of " in ext4_feature_set_ok()
3600 (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_ro_compat) & in ext4_feature_set_ok()
3604 if (ext4_has_feature_bigalloc(sb) && !ext4_has_feature_extents(sb)) { in ext4_feature_set_ok()
3605 ext4_msg(sb, KERN_ERR, in ext4_feature_set_ok()
3612 if (!readonly && (ext4_has_feature_quota(sb) || in ext4_feature_set_ok()
3613 ext4_has_feature_project(sb))) { in ext4_feature_set_ok()
3614 ext4_msg(sb, KERN_ERR, in ext4_feature_set_ok()
3629 struct super_block *sb = sbi->s_sb; in print_daily_error_info() local
3634 ext4_msg(sb, KERN_NOTICE, "error count since last fsck: %u", in print_daily_error_info()
3638 sb->s_id, in print_daily_error_info()
3653 sb->s_id, in print_daily_error_info()
3673 struct super_block *sb = elr->lr_super; in ext4_run_li_request() local
3674 ext4_group_t ngroups = EXT4_SB(sb)->s_groups_count; in ext4_run_li_request()
3678 int nr = EXT4_SB(sb)->s_mb_prefetch; in ext4_run_li_request()
3682 elr->lr_next_group = ext4_mb_prefetch(sb, group, nr, &prefetch_ios); in ext4_run_li_request()
3683 ext4_mb_prefetch_fini(sb, elr->lr_next_group, nr); in ext4_run_li_request()
3684 trace_ext4_prefetch_bitmaps(sb, group, elr->lr_next_group, nr); in ext4_run_li_request()
3688 !sb_rdonly(sb) && test_opt(sb, INIT_INODE_TABLE)) { in ext4_run_li_request()
3698 gdp = ext4_get_group_desc(sb, group, NULL); in ext4_run_li_request()
3713 ret = ext4_init_inode_table(sb, group, in ext4_run_li_request()
3715 trace_ext4_lazy_itable_init(sb, group); in ext4_run_li_request()
3740 static void ext4_unregister_li_request(struct super_block *sb) in ext4_unregister_li_request() argument
3749 ext4_remove_li_request(EXT4_SB(sb)->s_li_request); in ext4_unregister_li_request()
3799 * We hold sb->s_umount, sb can not in ext4_lazyinit_thread()
3904 static ext4_group_t ext4_has_uninit_itable(struct super_block *sb) in ext4_has_uninit_itable() argument
3906 ext4_group_t group, ngroups = EXT4_SB(sb)->s_groups_count; in ext4_has_uninit_itable()
3909 if (!ext4_has_group_desc_csum(sb)) in ext4_has_uninit_itable()
3913 gdp = ext4_get_group_desc(sb, group, NULL); in ext4_has_uninit_itable()
3942 static struct ext4_li_request *ext4_li_request_new(struct super_block *sb, in ext4_li_request_new() argument
3951 elr->lr_super = sb; in ext4_li_request_new()
3953 if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS)) { in ext4_li_request_new()
3969 int ext4_register_li_request(struct super_block *sb, in ext4_register_li_request() argument
3972 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_register_li_request()
3987 if (sb_rdonly(sb) || in ext4_register_li_request()
3988 (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) && in ext4_register_li_request()
3989 (first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE)))) in ext4_register_li_request()
3992 elr = ext4_li_request_new(sb, first_not_zeroed); in ext4_register_li_request()
4044 static int set_journal_csum_feature_set(struct super_block *sb) in set_journal_csum_feature_set() argument
4048 struct ext4_sb_info *sbi = EXT4_SB(sb); in set_journal_csum_feature_set()
4050 if (ext4_has_metadata_csum(sb)) { in set_journal_csum_feature_set()
4064 if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { in set_journal_csum_feature_set()
4069 } else if (test_opt(sb, JOURNAL_CHECKSUM)) { in set_journal_csum_feature_set()
4098 static int count_overhead(struct super_block *sb, ext4_group_t grp, in count_overhead() argument
4101 struct ext4_sb_info *sbi = EXT4_SB(sb); in count_overhead()
4104 ext4_group_t i, ngroups = ext4_get_groups_count(sb); in count_overhead()
4106 int has_super = ext4_bg_has_super(sb, grp); in count_overhead()
4108 if (!ext4_has_feature_bigalloc(sb)) in count_overhead()
4109 return (has_super + ext4_bg_num_gdb(sb, grp) + in count_overhead()
4114 (grp * EXT4_BLOCKS_PER_GROUP(sb)); in count_overhead()
4115 last_block = first_block + EXT4_BLOCKS_PER_GROUP(sb) - 1; in count_overhead()
4117 gdp = ext4_get_group_desc(sb, i, NULL); in count_overhead()
4118 b = ext4_block_bitmap(sb, gdp); in count_overhead()
4123 b = ext4_inode_bitmap(sb, gdp); in count_overhead()
4128 b = ext4_inode_table(sb, gdp); in count_overhead()
4138 if (ext4_bg_has_super(sb, grp)) { in count_overhead()
4142 j = ext4_bg_num_gdb(sb, grp); in count_overhead()
4143 if (s + j > EXT4_BLOCKS_PER_GROUP(sb)) { in count_overhead()
4144 ext4_error(sb, "Invalid number of block group " in count_overhead()
4146 j = EXT4_BLOCKS_PER_GROUP(sb) - s; in count_overhead()
4154 return EXT4_CLUSTERS_PER_GROUP(sb) - in count_overhead()
4155 ext4_count_free(buf, EXT4_CLUSTERS_PER_GROUP(sb) / 8); in count_overhead()
4161 int ext4_calculate_overhead(struct super_block *sb) in ext4_calculate_overhead() argument
4163 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_calculate_overhead()
4167 ext4_group_t i, ngroups = ext4_get_groups_count(sb); in ext4_calculate_overhead()
4191 blks = count_overhead(sb, i, buf); in ext4_calculate_overhead()
4204 else if (ext4_has_feature_journal(sb) && !sbi->s_journal && j_inum) { in ext4_calculate_overhead()
4206 j_inode = ext4_get_journal_inode(sb, j_inum); in ext4_calculate_overhead()
4208 j_blocks = j_inode->i_size >> sb->s_blocksize_bits; in ext4_calculate_overhead()
4212 ext4_msg(sb, KERN_ERR, "can't get journal size"); in ext4_calculate_overhead()
4221 static void ext4_set_resv_clusters(struct super_block *sb) in ext4_set_resv_clusters() argument
4224 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_set_resv_clusters()
4232 if (!ext4_has_feature_extents(sb)) in ext4_set_resv_clusters()
4251 static const char *ext4_quota_mode(struct super_block *sb) in ext4_quota_mode() argument
4254 if (!ext4_quota_capable(sb)) in ext4_quota_mode()
4257 if (EXT4_SB(sb)->s_journal && ext4_is_quota_journalled(sb)) in ext4_quota_mode()
4266 static void ext4_setup_csum_trigger(struct super_block *sb, in ext4_setup_csum_trigger() argument
4274 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_setup_csum_trigger()
4276 sbi->s_journal_triggers[type].sb = sb; in ext4_setup_csum_trigger()
4290 static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb) in ext4_alloc_sbi() argument
4298 sbi->s_daxdev = fs_dax_get_by_bdev(sb->s_bdev, &sbi->s_dax_part_off, in ext4_alloc_sbi()
4307 sb->s_fs_info = sbi; in ext4_alloc_sbi()
4308 sbi->s_sb = sb; in ext4_alloc_sbi()
4316 static void ext4_set_def_opts(struct super_block *sb, in ext4_set_def_opts() argument
4323 set_opt(sb, INIT_INODE_TABLE); in ext4_set_def_opts()
4325 set_opt(sb, DEBUG); in ext4_set_def_opts()
4327 set_opt(sb, GRPID); in ext4_set_def_opts()
4329 set_opt(sb, NO_UID32); in ext4_set_def_opts()
4331 set_opt(sb, XATTR_USER); in ext4_set_def_opts()
4333 set_opt(sb, POSIX_ACL); in ext4_set_def_opts()
4335 if (ext4_has_feature_fast_commit(sb)) in ext4_set_def_opts()
4336 set_opt2(sb, JOURNAL_FAST_COMMIT); in ext4_set_def_opts()
4338 if (ext4_has_metadata_csum(sb)) in ext4_set_def_opts()
4339 set_opt(sb, JOURNAL_CHECKSUM); in ext4_set_def_opts()
4342 set_opt(sb, JOURNAL_DATA); in ext4_set_def_opts()
4344 set_opt(sb, ORDERED_DATA); in ext4_set_def_opts()
4346 set_opt(sb, WRITEBACK_DATA); in ext4_set_def_opts()
4349 set_opt(sb, ERRORS_PANIC); in ext4_set_def_opts()
4351 set_opt(sb, ERRORS_CONT); in ext4_set_def_opts()
4353 set_opt(sb, ERRORS_RO); in ext4_set_def_opts()
4355 set_opt(sb, BLOCK_VALIDITY); in ext4_set_def_opts()
4357 set_opt(sb, DISCARD); in ext4_set_def_opts()
4360 set_opt(sb, BARRIER); in ext4_set_def_opts()
4366 if (!IS_EXT3_SB(sb) && !IS_EXT2_SB(sb) && in ext4_set_def_opts()
4368 set_opt(sb, DELALLOC); in ext4_set_def_opts()
4370 if (sb->s_blocksize <= PAGE_SIZE) in ext4_set_def_opts()
4371 set_opt(sb, DIOREAD_NOLOCK); in ext4_set_def_opts()
4374 static int ext4_handle_clustersize(struct super_block *sb) in ext4_handle_clustersize() argument
4376 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_handle_clustersize()
4382 if (ext4_has_feature_bigalloc(sb)) { in ext4_handle_clustersize()
4383 if (clustersize < sb->s_blocksize) { in ext4_handle_clustersize()
4384 ext4_msg(sb, KERN_ERR, in ext4_handle_clustersize()
4386 "block size (%lu)", clustersize, sb->s_blocksize); in ext4_handle_clustersize()
4392 if (clustersize != sb->s_blocksize) { in ext4_handle_clustersize()
4393 ext4_msg(sb, KERN_ERR, in ext4_handle_clustersize()
4395 "block size (%lu)", clustersize, sb->s_blocksize); in ext4_handle_clustersize()
4398 if (sbi->s_blocks_per_group > sb->s_blocksize * 8) { in ext4_handle_clustersize()
4399 ext4_msg(sb, KERN_ERR, in ext4_handle_clustersize()
4407 if (sbi->s_clusters_per_group > sb->s_blocksize * 8) { in ext4_handle_clustersize()
4408 ext4_msg(sb, KERN_ERR, "#clusters per group too big: %lu", in ext4_handle_clustersize()
4413 (sbi->s_clusters_per_group * (clustersize / sb->s_blocksize))) { in ext4_handle_clustersize()
4414 ext4_msg(sb, KERN_ERR, in ext4_handle_clustersize()
4419 sbi->s_cluster_ratio = clustersize / sb->s_blocksize; in ext4_handle_clustersize()
4423 set_opt2(sb, STD_GROUP_SIZE); in ext4_handle_clustersize()
4428 static void ext4_fast_commit_init(struct super_block *sb) in ext4_fast_commit_init() argument
4430 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_fast_commit_init()
4439 ext4_clear_mount_flag(sb, EXT4_MF_FC_INELIGIBLE); in ext4_fast_commit_init()
4452 static int ext4_inode_info_init(struct super_block *sb, in ext4_inode_info_init() argument
4455 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_inode_info_init()
4464 ext4_msg(sb, KERN_ERR, "invalid first ino: %u", in ext4_inode_info_init()
4470 (sbi->s_inode_size > sb->s_blocksize)) { in ext4_inode_info_init()
4471 ext4_msg(sb, KERN_ERR, in ext4_inode_info_init()
4474 ext4_msg(sb, KERN_ERR, "blocksize: %lu", sb->s_blocksize); in ext4_inode_info_init()
4485 sb->s_time_gran = 1; in ext4_inode_info_init()
4486 sb->s_time_max = EXT4_EXTRA_TIMESTAMP_MAX; in ext4_inode_info_init()
4488 sb->s_time_gran = NSEC_PER_SEC; in ext4_inode_info_init()
4489 sb->s_time_max = EXT4_NON_EXTRA_TIMESTAMP_MAX; in ext4_inode_info_init()
4491 sb->s_time_min = EXT4_TIMESTAMP_MIN; in ext4_inode_info_init()
4497 if (ext4_has_feature_extra_isize(sb)) { in ext4_inode_info_init()
4503 ext4_msg(sb, KERN_ERR, in ext4_inode_info_init()
4512 ext4_msg(sb, KERN_ERR, in ext4_inode_info_init()
4525 static int ext4_encoding_init(struct super_block *sb, struct ext4_super_block *es) in ext4_encoding_init() argument
4531 if (!ext4_has_feature_casefold(sb) || sb->s_encoding) in ext4_encoding_init()
4536 ext4_msg(sb, KERN_ERR, in ext4_encoding_init()
4543 ext4_msg(sb, KERN_ERR, in ext4_encoding_init()
4553 ext4_msg(sb, KERN_INFO,"Using encoding defined by superblock: " in ext4_encoding_init()
4560 sb->s_encoding = encoding; in ext4_encoding_init()
4561 sb->s_encoding_flags = encoding_flags; in ext4_encoding_init()
4566 static inline int ext4_encoding_init(struct super_block *sb, struct ext4_super_block *es) in ext4_encoding_init() argument
4572 static int ext4_init_metadata_csum(struct super_block *sb, struct ext4_super_block *es) in ext4_init_metadata_csum() argument
4574 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_init_metadata_csum()
4577 if (ext4_has_feature_metadata_csum(sb) && in ext4_init_metadata_csum()
4578 ext4_has_feature_gdt_csum(sb)) in ext4_init_metadata_csum()
4579 ext4_warning(sb, "metadata_csum and uninit_bg are " in ext4_init_metadata_csum()
4583 if (!ext4_verify_csum_type(sb, es)) { in ext4_init_metadata_csum()
4584 ext4_msg(sb, KERN_ERR, "VFS: Found ext4 filesystem with " in ext4_init_metadata_csum()
4588 ext4_setup_csum_trigger(sb, EXT4_JTR_ORPHAN_FILE, in ext4_init_metadata_csum()
4595 ext4_msg(sb, KERN_ERR, "Cannot load crc32c driver."); in ext4_init_metadata_csum()
4601 if (!ext4_superblock_csum_verify(sb, es)) { in ext4_init_metadata_csum()
4602 ext4_msg(sb, KERN_ERR, "VFS: Found ext4 filesystem with " in ext4_init_metadata_csum()
4608 if (ext4_has_feature_csum_seed(sb)) in ext4_init_metadata_csum()
4610 else if (ext4_has_metadata_csum(sb) || ext4_has_feature_ea_inode(sb)) in ext4_init_metadata_csum()
4616 static int ext4_check_feature_compatibility(struct super_block *sb, in ext4_check_feature_compatibility() argument
4620 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_check_feature_compatibility()
4623 (ext4_has_compat_features(sb) || in ext4_check_feature_compatibility()
4624 ext4_has_ro_compat_features(sb) || in ext4_check_feature_compatibility()
4625 ext4_has_incompat_features(sb))) in ext4_check_feature_compatibility()
4626 ext4_msg(sb, KERN_WARNING, in ext4_check_feature_compatibility()
4631 set_opt2(sb, HURD_COMPAT); in ext4_check_feature_compatibility()
4632 if (ext4_has_feature_64bit(sb)) { in ext4_check_feature_compatibility()
4633 ext4_msg(sb, KERN_ERR, in ext4_check_feature_compatibility()
4642 if (ext4_has_feature_ea_inode(sb)) { in ext4_check_feature_compatibility()
4643 ext4_msg(sb, KERN_ERR, in ext4_check_feature_compatibility()
4649 if (IS_EXT2_SB(sb)) { in ext4_check_feature_compatibility()
4650 if (ext2_feature_set_ok(sb)) in ext4_check_feature_compatibility()
4651 ext4_msg(sb, KERN_INFO, "mounting ext2 file system " in ext4_check_feature_compatibility()
4658 if (silent && ext4_feature_set_ok(sb, sb_rdonly(sb))) in ext4_check_feature_compatibility()
4660 ext4_msg(sb, KERN_ERR, "couldn't mount as ext2 due " in ext4_check_feature_compatibility()
4666 if (IS_EXT3_SB(sb)) { in ext4_check_feature_compatibility()
4667 if (ext3_feature_set_ok(sb)) in ext4_check_feature_compatibility()
4668 ext4_msg(sb, KERN_INFO, "mounting ext3 file system " in ext4_check_feature_compatibility()
4675 if (silent && ext4_feature_set_ok(sb, sb_rdonly(sb))) in ext4_check_feature_compatibility()
4677 ext4_msg(sb, KERN_ERR, "couldn't mount as ext3 due " in ext4_check_feature_compatibility()
4688 if (!ext4_feature_set_ok(sb, (sb_rdonly(sb)))) in ext4_check_feature_compatibility()
4692 if (sb->s_blocksize == PAGE_SIZE) in ext4_check_feature_compatibility()
4695 ext4_msg(sb, KERN_ERR, "unsupported blocksize for DAX\n"); in ext4_check_feature_compatibility()
4699 if (ext4_has_feature_inline_data(sb)) { in ext4_check_feature_compatibility()
4700 ext4_msg(sb, KERN_ERR, "Cannot use DAX on a filesystem" in ext4_check_feature_compatibility()
4705 ext4_msg(sb, KERN_ERR, in ext4_check_feature_compatibility()
4711 if (ext4_has_feature_encrypt(sb) && es->s_encryption_level) { in ext4_check_feature_compatibility()
4712 ext4_msg(sb, KERN_ERR, "Unsupported encryption level %d", in ext4_check_feature_compatibility()
4720 static int ext4_check_geometry(struct super_block *sb, in ext4_check_geometry() argument
4723 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_check_geometry()
4727 if (le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) > (sb->s_blocksize / 4)) { in ext4_check_geometry()
4728 ext4_msg(sb, KERN_ERR, in ext4_check_geometry()
4737 err = generic_check_addressable(sb->s_blocksize_bits, in ext4_check_geometry()
4740 ext4_msg(sb, KERN_ERR, "filesystem" in ext4_check_geometry()
4746 blocks_count = sb_bdev_nr_blocks(sb); in ext4_check_geometry()
4748 ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu " in ext4_check_geometry()
4759 ext4_msg(sb, KERN_WARNING, "bad geometry: first data " in ext4_check_geometry()
4767 ext4_msg(sb, KERN_WARNING, "bad geometry: first data " in ext4_check_geometry()
4774 EXT4_BLOCKS_PER_GROUP(sb) - 1); in ext4_check_geometry()
4775 do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb)); in ext4_check_geometry()
4776 if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) { in ext4_check_geometry()
4777 ext4_msg(sb, KERN_WARNING, "groups count too large: %llu " in ext4_check_geometry()
4782 EXT4_BLOCKS_PER_GROUP(sb)); in ext4_check_geometry()
4787 (EXT4_MAX_BLOCK_FILE_PHYS / EXT4_BLOCKS_PER_GROUP(sb))); in ext4_check_geometry()
4790 ext4_msg(sb, KERN_ERR, "inodes count not valid: %u vs %llu", in ext4_check_geometry()
4799 static int ext4_group_desc_init(struct super_block *sb, in ext4_group_desc_init() argument
4804 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_group_desc_init()
4809 db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) / in ext4_group_desc_init()
4810 EXT4_DESC_PER_BLOCK(sb); in ext4_group_desc_init()
4811 if (ext4_has_feature_meta_bg(sb)) { in ext4_group_desc_init()
4813 ext4_msg(sb, KERN_WARNING, in ext4_group_desc_init()
4825 ext4_msg(sb, KERN_ERR, "not enough memory"); in ext4_group_desc_init()
4833 block = descriptor_loc(sb, logical_sb_block, i); in ext4_group_desc_init()
4834 ext4_sb_breadahead_unmovable(sb, block); in ext4_group_desc_init()
4840 block = descriptor_loc(sb, logical_sb_block, i); in ext4_group_desc_init()
4841 bh = ext4_sb_bread_unmovable(sb, block); in ext4_group_desc_init()
4843 ext4_msg(sb, KERN_ERR, in ext4_group_desc_init()
4853 if (!ext4_check_descriptors(sb, logical_sb_block, first_not_zeroed)) { in ext4_group_desc_init()
4854 ext4_msg(sb, KERN_ERR, "group descriptors corrupted!"); in ext4_group_desc_init()
4861 static int ext4_load_and_init_journal(struct super_block *sb, in ext4_load_and_init_journal() argument
4865 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_load_and_init_journal()
4868 err = ext4_load_journal(sb, es, ctx->journal_devnum); in ext4_load_and_init_journal()
4872 if (ext4_has_feature_64bit(sb) && in ext4_load_and_init_journal()
4873 !jbd2_journal_set_features(EXT4_SB(sb)->s_journal, 0, 0, in ext4_load_and_init_journal()
4875 ext4_msg(sb, KERN_ERR, "Failed to set 64-bit journal feature"); in ext4_load_and_init_journal()
4879 if (!set_journal_csum_feature_set(sb)) { in ext4_load_and_init_journal()
4880 ext4_msg(sb, KERN_ERR, "Failed to set journal checksum " in ext4_load_and_init_journal()
4885 if (test_opt2(sb, JOURNAL_FAST_COMMIT) && in ext4_load_and_init_journal()
4886 !jbd2_journal_set_features(EXT4_SB(sb)->s_journal, 0, 0, in ext4_load_and_init_journal()
4888 ext4_msg(sb, KERN_ERR, in ext4_load_and_init_journal()
4895 switch (test_opt(sb, DATA_FLAGS)) { in ext4_load_and_init_journal()
4903 set_opt(sb, ORDERED_DATA); in ext4_load_and_init_journal()
4906 set_opt(sb, JOURNAL_DATA); in ext4_load_and_init_journal()
4915 ext4_msg(sb, KERN_ERR, "Journal does not support " in ext4_load_and_init_journal()
4924 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA && in ext4_load_and_init_journal()
4925 test_opt(sb, JOURNAL_ASYNC_COMMIT)) { in ext4_load_and_init_journal()
4926 ext4_msg(sb, KERN_ERR, "can't mount with " in ext4_load_and_init_journal()
4948 static int ext4_check_journal_data_mode(struct super_block *sb) in ext4_check_journal_data_mode() argument
4950 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { in ext4_check_journal_data_mode()
4955 clear_opt(sb, DIOREAD_NOLOCK); in ext4_check_journal_data_mode()
4956 clear_opt2(sb, JOURNAL_FAST_COMMIT); in ext4_check_journal_data_mode()
4957 if (test_opt2(sb, EXPLICIT_DELALLOC)) { in ext4_check_journal_data_mode()
4958 ext4_msg(sb, KERN_ERR, "can't mount with " in ext4_check_journal_data_mode()
4962 if (test_opt(sb, DAX_ALWAYS)) { in ext4_check_journal_data_mode()
4963 ext4_msg(sb, KERN_ERR, "can't mount with " in ext4_check_journal_data_mode()
4967 if (ext4_has_feature_encrypt(sb)) { in ext4_check_journal_data_mode()
4968 ext4_msg(sb, KERN_WARNING, in ext4_check_journal_data_mode()
4972 if (test_opt(sb, DELALLOC)) in ext4_check_journal_data_mode()
4973 clear_opt(sb, DELALLOC); in ext4_check_journal_data_mode()
4975 sb->s_iflags |= SB_I_CGROUPWB; in ext4_check_journal_data_mode()
4981 static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb, in ext4_load_super() argument
4984 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_load_super()
4992 blocksize = sb_min_blocksize(sb, EXT4_MIN_BLOCK_SIZE); in ext4_load_super()
4994 ext4_msg(sb, KERN_ERR, "unable to set blocksize"); in ext4_load_super()
5009 bh = ext4_sb_bread_unmovable(sb, logical_sb_block); in ext4_load_super()
5011 ext4_msg(sb, KERN_ERR, "unable to read superblock"); in ext4_load_super()
5020 sb->s_magic = le16_to_cpu(es->s_magic); in ext4_load_super()
5021 if (sb->s_magic != EXT4_SUPER_MAGIC) { in ext4_load_super()
5023 ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem"); in ext4_load_super()
5029 ext4_msg(sb, KERN_ERR, in ext4_load_super()
5036 ext4_msg(sb, KERN_ERR, in ext4_load_super()
5048 if (sb->s_blocksize == blocksize) { in ext4_load_super()
5061 if (!sb_set_blocksize(sb, blocksize)) { in ext4_load_super()
5062 ext4_msg(sb, KERN_ERR, "bad block size %d", in ext4_load_super()
5070 bh = ext4_sb_bread_unmovable(sb, logical_sb_block); in ext4_load_super()
5072 ext4_msg(sb, KERN_ERR, "Can't read superblock on 2nd try"); in ext4_load_super()
5080 ext4_msg(sb, KERN_ERR, "Magic mismatch, very weird!"); in ext4_load_super()
5091 static int ext4_hash_info_init(struct super_block *sb) in ext4_hash_info_init() argument
5093 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_hash_info_init()
5100 ext4_msg(sb, KERN_ERR, in ext4_hash_info_init()
5104 ext4_msg(sb, KERN_ERR, in ext4_hash_info_init()
5112 if (ext4_has_feature_dir_index(sb)) { in ext4_hash_info_init()
5118 if (!sb_rdonly(sb)) in ext4_hash_info_init()
5123 if (!sb_rdonly(sb)) in ext4_hash_info_init()
5132 static int ext4_block_group_meta_init(struct super_block *sb, int silent) in ext4_block_group_meta_init() argument
5134 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_block_group_meta_init()
5138 has_huge_files = ext4_has_feature_huge_file(sb); in ext4_block_group_meta_init()
5139 sbi->s_bitmap_maxbytes = ext4_max_bitmap_size(sb->s_blocksize_bits, in ext4_block_group_meta_init()
5141 sb->s_maxbytes = ext4_max_size(sb->s_blocksize_bits, has_huge_files); in ext4_block_group_meta_init()
5144 if (ext4_has_feature_64bit(sb)) { in ext4_block_group_meta_init()
5148 ext4_msg(sb, KERN_ERR, in ext4_block_group_meta_init()
5159 sbi->s_inodes_per_block = sb->s_blocksize / EXT4_INODE_SIZE(sb); in ext4_block_group_meta_init()
5162 ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem"); in ext4_block_group_meta_init()
5166 sbi->s_inodes_per_group > sb->s_blocksize * 8) { in ext4_block_group_meta_init()
5167 ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n", in ext4_block_group_meta_init()
5173 sbi->s_desc_per_block = sb->s_blocksize / EXT4_DESC_SIZE(sb); in ext4_block_group_meta_init()
5175 sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); in ext4_block_group_meta_init()
5176 sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); in ext4_block_group_meta_init()
5186 static bool ext4_is_stripe_incompatible(struct super_block *sb, unsigned long stripe) in ext4_is_stripe_incompatible() argument
5188 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_is_stripe_incompatible()
5193 static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) in __ext4_fill_super() argument
5196 struct ext4_sb_info *sbi = EXT4_SB(sb); in __ext4_fill_super()
5211 part_stat_read(sb->s_bdev, sectors[STAT_WRITE]); in __ext4_fill_super()
5213 err = ext4_load_super(sb, &logical_sb_block, silent); in __ext4_fill_super()
5220 err = ext4_init_metadata_csum(sb, es); in __ext4_fill_super()
5224 ext4_set_def_opts(sb, es); in __ext4_fill_super()
5238 err = ext4_inode_info_init(sb, es); in __ext4_fill_super()
5242 err = parse_apply_sb_mount_options(sb, ctx); in __ext4_fill_super()
5249 err = ext4_check_opt_consistency(fc, sb); in __ext4_fill_super()
5253 ext4_apply_options(fc, sb); in __ext4_fill_super()
5255 err = ext4_encoding_init(sb, es); in __ext4_fill_super()
5259 err = ext4_check_journal_data_mode(sb); in __ext4_fill_super()
5263 sb->s_flags = (sb->s_flags & ~SB_POSIXACL) | in __ext4_fill_super()
5264 (test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0); in __ext4_fill_super()
5267 sb->s_flags |= SB_I_VERSION; in __ext4_fill_super()
5269 err = ext4_check_feature_compatibility(sb, es, silent); in __ext4_fill_super()
5273 err = ext4_block_group_meta_init(sb, silent); in __ext4_fill_super()
5277 err = ext4_hash_info_init(sb); in __ext4_fill_super()
5281 err = ext4_handle_clustersize(sb); in __ext4_fill_super()
5285 err = ext4_check_geometry(sb, es); in __ext4_fill_super()
5293 err = ext4_group_desc_init(sb, es, logical_sb_block, &first_not_zeroed); in __ext4_fill_super()
5302 if (ext4_is_stripe_incompatible(sb, sbi->s_stripe)) { in __ext4_fill_super()
5303 ext4_msg(sb, KERN_WARNING, in __ext4_fill_super()
5314 sb->s_op = &ext4_sops; in __ext4_fill_super()
5315 sb->s_export_op = &ext4_export_ops; in __ext4_fill_super()
5316 sb->s_xattr = ext4_xattr_handlers; in __ext4_fill_super()
5318 sb->s_cop = &ext4_cryptops; in __ext4_fill_super()
5321 sb->s_vop = &ext4_verityops; in __ext4_fill_super()
5324 sb->dq_op = &ext4_quota_operations; in __ext4_fill_super()
5325 if (ext4_has_feature_quota(sb)) in __ext4_fill_super()
5326 sb->s_qcop = &dquot_quotactl_sysfile_ops; in __ext4_fill_super()
5328 sb->s_qcop = &ext4_qctl_operations; in __ext4_fill_super()
5329 sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; in __ext4_fill_super()
5331 super_set_uuid(sb, es->s_uuid, sizeof(es->s_uuid)); in __ext4_fill_super()
5332 super_set_sysfs_name_bdev(sb); in __ext4_fill_super()
5339 ext4_fast_commit_init(sb); in __ext4_fill_super()
5341 sb->s_root = NULL; in __ext4_fill_super()
5344 ext4_has_feature_orphan_present(sb) || in __ext4_fill_super()
5345 ext4_has_feature_journal_needs_recovery(sb)); in __ext4_fill_super()
5347 if (ext4_has_feature_mmp(sb) && !sb_rdonly(sb)) { in __ext4_fill_super()
5348 err = ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)); in __ext4_fill_super()
5358 if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) { in __ext4_fill_super()
5359 err = ext4_load_and_init_journal(sb, es, ctx); in __ext4_fill_super()
5362 } else if (test_opt(sb, NOLOAD) && !sb_rdonly(sb) && in __ext4_fill_super()
5363 ext4_has_feature_journal_needs_recovery(sb)) { in __ext4_fill_super()
5364 ext4_msg(sb, KERN_ERR, "required journal recovery " in __ext4_fill_super()
5369 if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { in __ext4_fill_super()
5370 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_fill_super()
5375 if (test_opt2(sb, EXPLICIT_JOURNAL_CHECKSUM)) { in __ext4_fill_super()
5376 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_fill_super()
5381 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_fill_super()
5388 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_fill_super()
5393 clear_opt(sb, JOURNAL_CHECKSUM); in __ext4_fill_super()
5394 clear_opt(sb, DATA_FLAGS); in __ext4_fill_super()
5395 clear_opt2(sb, JOURNAL_FAST_COMMIT); in __ext4_fill_super()
5400 if (!test_opt(sb, NO_MBCACHE)) { in __ext4_fill_super()
5403 ext4_msg(sb, KERN_ERR, in __ext4_fill_super()
5409 if (ext4_has_feature_ea_inode(sb)) { in __ext4_fill_super()
5412 ext4_msg(sb, KERN_ERR, in __ext4_fill_super()
5433 if (!ext4_has_feature_bigalloc(sb)) in __ext4_fill_super()
5436 err = ext4_calculate_overhead(sb); in __ext4_fill_super()
5445 EXT4_SB(sb)->rsv_conversion_wq = in __ext4_fill_super()
5447 if (!EXT4_SB(sb)->rsv_conversion_wq) { in __ext4_fill_super()
5458 root = ext4_iget(sb, EXT4_ROOT_INO, EXT4_IGET_SPECIAL); in __ext4_fill_super()
5460 ext4_msg(sb, KERN_ERR, "get root inode failed"); in __ext4_fill_super()
5466 ext4_msg(sb, KERN_ERR, "corrupt root inode, run e2fsck"); in __ext4_fill_super()
5472 generic_set_sb_d_ops(sb); in __ext4_fill_super()
5473 sb->s_root = d_make_root(root); in __ext4_fill_super()
5474 if (!sb->s_root) { in __ext4_fill_super()
5475 ext4_msg(sb, KERN_ERR, "get root dentry failed"); in __ext4_fill_super()
5480 err = ext4_setup_super(sb, es, sb_rdonly(sb)); in __ext4_fill_super()
5482 sb->s_flags |= SB_RDONLY; in __ext4_fill_super()
5486 ext4_set_resv_clusters(sb); in __ext4_fill_super()
5488 if (test_opt(sb, BLOCK_VALIDITY)) { in __ext4_fill_super()
5489 err = ext4_setup_system_zone(sb); in __ext4_fill_super()
5491 ext4_msg(sb, KERN_ERR, "failed to initialize system " in __ext4_fill_super()
5496 ext4_fc_replay_cleanup(sb); in __ext4_fill_super()
5498 ext4_ext_init(sb); in __ext4_fill_super()
5507 set_opt2(sb, MB_OPTIMIZE_SCAN); in __ext4_fill_super()
5509 clear_opt2(sb, MB_OPTIMIZE_SCAN); in __ext4_fill_super()
5512 err = ext4_mb_init(sb); in __ext4_fill_super()
5514 ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)", in __ext4_fill_super()
5531 if (ext4_has_feature_flex_bg(sb)) in __ext4_fill_super()
5532 if (!ext4_fill_flex_info(sb)) { in __ext4_fill_super()
5533 ext4_msg(sb, KERN_ERR, in __ext4_fill_super()
5540 err = ext4_register_li_request(sb, first_not_zeroed); in __ext4_fill_super()
5544 err = ext4_init_orphan_info(sb); in __ext4_fill_super()
5549 if (ext4_has_feature_quota(sb) && !sb_rdonly(sb)) { in __ext4_fill_super()
5550 err = ext4_enable_quotas(sb); in __ext4_fill_super()
5560 errseq_check_and_advance(&sb->s_bdev->bd_mapping->wb_err, in __ext4_fill_super()
5562 EXT4_SB(sb)->s_mount_state |= EXT4_ORPHAN_FS; in __ext4_fill_super()
5563 ext4_orphan_cleanup(sb, es); in __ext4_fill_super()
5564 EXT4_SB(sb)->s_mount_state &= ~EXT4_ORPHAN_FS; in __ext4_fill_super()
5572 ext4_superblock_csum_set(sb); in __ext4_fill_super()
5574 ext4_msg(sb, KERN_INFO, "recovery complete"); in __ext4_fill_super()
5575 err = ext4_mark_recovery_complete(sb, es); in __ext4_fill_super()
5580 if (test_opt(sb, DISCARD) && !bdev_max_discard_sectors(sb->s_bdev)) in __ext4_fill_super()
5581 ext4_msg(sb, KERN_WARNING, in __ext4_fill_super()
5595 err = ext4_register_sysfs(sb); in __ext4_fill_super()
5602 ext4_quotas_off(sb, EXT4_MAXQUOTAS); in __ext4_fill_super()
5604 ext4_release_orphan_info(sb); in __ext4_fill_super()
5606 ext4_unregister_li_request(sb); in __ext4_fill_super()
5608 ext4_mb_release(sb); in __ext4_fill_super()
5612 ext4_ext_release(sb); in __ext4_fill_super()
5613 ext4_release_system_zone(sb); in __ext4_fill_super()
5615 dput(sb->s_root); in __ext4_fill_super()
5616 sb->s_root = NULL; in __ext4_fill_super()
5618 ext4_msg(sb, KERN_ERR, "mount failed"); in __ext4_fill_super()
5619 if (EXT4_SB(sb)->rsv_conversion_wq) in __ext4_fill_super()
5620 destroy_workqueue(EXT4_SB(sb)->rsv_conversion_wq); in __ext4_fill_super()
5647 utf8_unload(sb->s_encoding); in __ext4_fill_super()
5652 kfree(get_qf_name(sb, sbi, i)); in __ext4_fill_super()
5661 invalidate_bdev(sb->s_bdev); in __ext4_fill_super()
5662 sb->s_fs_info = NULL; in __ext4_fill_super()
5666 static int ext4_fill_super(struct super_block *sb, struct fs_context *fc) in ext4_fill_super() argument
5673 sbi = ext4_alloc_sbi(sb); in ext4_fill_super()
5680 strreplace(sb->s_id, '/', '!'); in ext4_fill_super()
5686 ret = __ext4_fill_super(fc, sb); in ext4_fill_super()
5691 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) in ext4_fill_super()
5693 else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) in ext4_fill_super()
5701 ext4_msg(sb, KERN_INFO, "mounted filesystem %pU %s with%s. " in ext4_fill_super()
5702 "Quota mode: %s.", &sb->s_uuid, in ext4_fill_super()
5703 sb_rdonly(sb) ? "ro" : "r/w", descr, in ext4_fill_super()
5704 ext4_quota_mode(sb)); in ext4_fill_super()
5707 ext4_update_overhead(sb, false); in ext4_fill_super()
5726 static void ext4_init_journal_params(struct super_block *sb, journal_t *journal) in ext4_init_journal_params() argument
5728 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_init_journal_params()
5733 ext4_fc_init(sb, journal); in ext4_init_journal_params()
5736 if (test_opt(sb, BARRIER)) in ext4_init_journal_params()
5740 if (test_opt(sb, DATA_ERR_ABORT)) in ext4_init_journal_params()
5752 static struct inode *ext4_get_journal_inode(struct super_block *sb, in ext4_get_journal_inode() argument
5762 journal_inode = ext4_iget(sb, journal_inum, EXT4_IGET_SPECIAL); in ext4_get_journal_inode()
5764 ext4_msg(sb, KERN_ERR, "no journal found"); in ext4_get_journal_inode()
5770 ext4_msg(sb, KERN_ERR, "journal inode is deleted"); in ext4_get_journal_inode()
5774 ext4_msg(sb, KERN_ERR, "invalid journal inode"); in ext4_get_journal_inode()
5806 static journal_t *ext4_open_inode_journal(struct super_block *sb, in ext4_open_inode_journal() argument
5812 journal_inode = ext4_get_journal_inode(sb, journal_inum); in ext4_open_inode_journal()
5818 ext4_msg(sb, KERN_ERR, "Could not load journal inode"); in ext4_open_inode_journal()
5822 journal->j_private = sb; in ext4_open_inode_journal()
5824 ext4_init_journal_params(sb, journal); in ext4_open_inode_journal()
5828 static struct file *ext4_get_journal_blkdev(struct super_block *sb, in ext4_get_journal_blkdev() argument
5843 sb, &fs_holder_ops); in ext4_get_journal_blkdev()
5845 ext4_msg(sb, KERN_ERR, in ext4_get_journal_blkdev()
5852 blocksize = sb->s_blocksize; in ext4_get_journal_blkdev()
5855 ext4_msg(sb, KERN_ERR, in ext4_get_journal_blkdev()
5866 ext4_msg(sb, KERN_ERR, "couldn't read superblock of " in ext4_get_journal_blkdev()
5876 ext4_msg(sb, KERN_ERR, "external journal has bad superblock"); in ext4_get_journal_blkdev()
5883 es->s_checksum != ext4_superblock_csum(sb, es)) { in ext4_get_journal_blkdev()
5884 ext4_msg(sb, KERN_ERR, "external journal has corrupt superblock"); in ext4_get_journal_blkdev()
5889 if (memcmp(EXT4_SB(sb)->s_es->s_journal_uuid, es->s_uuid, 16)) { in ext4_get_journal_blkdev()
5890 ext4_msg(sb, KERN_ERR, "journal UUID does not match"); in ext4_get_journal_blkdev()
5907 static journal_t *ext4_open_dev_journal(struct super_block *sb, in ext4_open_dev_journal() argument
5916 bdev_file = ext4_get_journal_blkdev(sb, j_dev, &j_start, &j_len); in ext4_open_dev_journal()
5920 journal = jbd2_journal_init_dev(file_bdev(bdev_file), sb->s_bdev, j_start, in ext4_open_dev_journal()
5921 j_len, sb->s_blocksize); in ext4_open_dev_journal()
5923 ext4_msg(sb, KERN_ERR, "failed to create device journal"); in ext4_open_dev_journal()
5928 ext4_msg(sb, KERN_ERR, "External journal has more than one " in ext4_open_dev_journal()
5934 journal->j_private = sb; in ext4_open_dev_journal()
5935 EXT4_SB(sb)->s_journal_bdev_file = bdev_file; in ext4_open_dev_journal()
5936 ext4_init_journal_params(sb, journal); in ext4_open_dev_journal()
5946 static int ext4_load_journal(struct super_block *sb, in ext4_load_journal() argument
5957 if (WARN_ON_ONCE(!ext4_has_feature_journal(sb))) in ext4_load_journal()
5962 ext4_msg(sb, KERN_INFO, "external journal device major/minor " in ext4_load_journal()
5969 ext4_msg(sb, KERN_ERR, in ext4_load_journal()
5975 journal = ext4_open_inode_journal(sb, journal_inum); in ext4_load_journal()
5979 journal = ext4_open_dev_journal(sb, journal_dev); in ext4_load_journal()
5985 really_read_only = bdev_read_only(sb->s_bdev) | journal_dev_ro; in ext4_load_journal()
5987 if (journal_dev_ro && !sb_rdonly(sb)) { in ext4_load_journal()
5988 ext4_msg(sb, KERN_ERR, in ext4_load_journal()
5999 if (ext4_has_feature_journal_needs_recovery(sb)) { in ext4_load_journal()
6000 if (sb_rdonly(sb)) { in ext4_load_journal()
6001 ext4_msg(sb, KERN_INFO, "INFO: recovery " in ext4_load_journal()
6004 ext4_msg(sb, KERN_ERR, "write access " in ext4_load_journal()
6010 ext4_msg(sb, KERN_INFO, "write access will " in ext4_load_journal()
6016 ext4_msg(sb, KERN_INFO, "barriers disabled"); in ext4_load_journal()
6018 if (!ext4_has_feature_journal_needs_recovery(sb)) in ext4_load_journal()
6037 es->s_state |= cpu_to_le16(EXT4_SB(sb)->s_mount_state & in ext4_load_journal()
6044 err2 = ext4_commit_super(sb); in ext4_load_journal()
6050 ext4_msg(sb, KERN_ERR, "error loading journal"); in ext4_load_journal()
6054 EXT4_SB(sb)->s_journal = journal; in ext4_load_journal()
6055 err = ext4_clear_journal_err(sb, es); in ext4_load_journal()
6057 EXT4_SB(sb)->s_journal = NULL; in ext4_load_journal()
6065 ext4_commit_super(sb); in ext4_load_journal()
6070 ext4_commit_super(sb); in ext4_load_journal()
6080 /* Copy state of EXT4_SB(sb) into buffer for on-disk superblock */
6081 static void ext4_update_super(struct super_block *sb) in ext4_update_super() argument
6083 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_update_super()
6098 if (!sb_rdonly(sb)) in ext4_update_super()
6102 ((part_stat_read(sb->s_bdev, sectors[STAT_WRITE]) - in ext4_update_super()
6151 ext4_superblock_csum_set(sb); in ext4_update_super()
6155 static int ext4_commit_super(struct super_block *sb) in ext4_commit_super() argument
6157 struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; in ext4_commit_super()
6162 ext4_update_super(sb); in ext4_commit_super()
6180 ext4_msg(sb, KERN_ERR, "previous I/O error to " in ext4_commit_super()
6190 (test_opt(sb, BARRIER) ? REQ_FUA : 0), sbh); in ext4_commit_super()
6193 ext4_msg(sb, KERN_ERR, "I/O error while writing " in ext4_commit_super()
6207 static int ext4_mark_recovery_complete(struct super_block *sb, in ext4_mark_recovery_complete() argument
6211 journal_t *journal = EXT4_SB(sb)->s_journal; in ext4_mark_recovery_complete()
6213 if (!ext4_has_feature_journal(sb)) { in ext4_mark_recovery_complete()
6215 ext4_error(sb, "Journal got removed while the fs was " in ext4_mark_recovery_complete()
6226 if (sb_rdonly(sb) && (ext4_has_feature_journal_needs_recovery(sb) || in ext4_mark_recovery_complete()
6227 ext4_has_feature_orphan_present(sb))) { in ext4_mark_recovery_complete()
6228 if (!ext4_orphan_file_empty(sb)) { in ext4_mark_recovery_complete()
6229 ext4_error(sb, "Orphan file not empty on read-only fs."); in ext4_mark_recovery_complete()
6233 ext4_clear_feature_journal_needs_recovery(sb); in ext4_mark_recovery_complete()
6234 ext4_clear_feature_orphan_present(sb); in ext4_mark_recovery_complete()
6235 ext4_commit_super(sb); in ext4_mark_recovery_complete()
6247 static int ext4_clear_journal_err(struct super_block *sb, in ext4_clear_journal_err() argument
6254 if (!ext4_has_feature_journal(sb)) { in ext4_clear_journal_err()
6255 ext4_error(sb, "Journal got removed while the fs was mounted!"); in ext4_clear_journal_err()
6259 journal = EXT4_SB(sb)->s_journal; in ext4_clear_journal_err()
6270 errstr = ext4_decode_error(sb, j_errno, nbuf); in ext4_clear_journal_err()
6271 ext4_warning(sb, "Filesystem error recorded " in ext4_clear_journal_err()
6274 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; in ext4_clear_journal_err()
6276 j_errno = ext4_commit_super(sb); in ext4_clear_journal_err()
6279 ext4_warning(sb, "Marked fs in need of filesystem check."); in ext4_clear_journal_err()
6291 int ext4_force_commit(struct super_block *sb) in ext4_force_commit() argument
6293 return ext4_journal_force_commit(EXT4_SB(sb)->s_journal); in ext4_force_commit()
6296 static int ext4_sync_fs(struct super_block *sb, int wait) in ext4_sync_fs() argument
6301 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_sync_fs()
6303 if (unlikely(ext4_forced_shutdown(sb))) in ext4_sync_fs()
6306 trace_ext4_sync_fs(sb, wait); in ext4_sync_fs()
6312 dquot_writeback_dquots(sb, -1); in ext4_sync_fs()
6329 } else if (wait && test_opt(sb, BARRIER)) in ext4_sync_fs()
6333 err = blkdev_issue_flush(sb->s_bdev); in ext4_sync_fs()
6349 static int ext4_freeze(struct super_block *sb) in ext4_freeze() argument
6352 journal_t *journal = EXT4_SB(sb)->s_journal; in ext4_freeze()
6367 ext4_clear_feature_journal_needs_recovery(sb); in ext4_freeze()
6368 if (ext4_orphan_file_empty(sb)) in ext4_freeze()
6369 ext4_clear_feature_orphan_present(sb); in ext4_freeze()
6372 error = ext4_commit_super(sb); in ext4_freeze()
6384 static int ext4_unfreeze(struct super_block *sb) in ext4_unfreeze() argument
6386 if (ext4_forced_shutdown(sb)) in ext4_unfreeze()
6389 if (EXT4_SB(sb)->s_journal) { in ext4_unfreeze()
6391 ext4_set_feature_journal_needs_recovery(sb); in ext4_unfreeze()
6392 if (ext4_has_feature_orphan_file(sb)) in ext4_unfreeze()
6393 ext4_set_feature_orphan_present(sb); in ext4_unfreeze()
6396 ext4_commit_super(sb); in ext4_unfreeze()
6416 static int __ext4_remount(struct fs_context *fc, struct super_block *sb) in __ext4_remount() argument
6420 struct ext4_sb_info *sbi = EXT4_SB(sb); in __ext4_remount()
6434 old_sb_flags = sb->s_flags; in __ext4_remount()
6446 char *qf_name = get_qf_name(sb, sbi, i); in __ext4_remount()
6467 ext4_is_stripe_incompatible(sb, ctx->s_stripe)) { in __ext4_remount()
6468 ext4_msg(sb, KERN_WARNING, in __ext4_remount()
6482 alloc_ctx = ext4_writepages_down_write(sb); in __ext4_remount()
6483 ext4_apply_options(fc, sb); in __ext4_remount()
6484 ext4_writepages_up_write(sb, alloc_ctx); in __ext4_remount()
6487 test_opt(sb, JOURNAL_CHECKSUM)) { in __ext4_remount()
6488 ext4_msg(sb, KERN_ERR, "changing journal_checksum " in __ext4_remount()
6493 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { in __ext4_remount()
6494 if (test_opt2(sb, EXPLICIT_DELALLOC)) { in __ext4_remount()
6495 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_remount()
6500 if (test_opt(sb, DIOREAD_NOLOCK)) { in __ext4_remount()
6501 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_remount()
6506 } else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) { in __ext4_remount()
6507 if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { in __ext4_remount()
6508 ext4_msg(sb, KERN_ERR, "can't mount with " in __ext4_remount()
6516 ext4_msg(sb, KERN_ERR, "can't enable nombcache during remount"); in __ext4_remount()
6521 if (test_opt2(sb, ABORT)) in __ext4_remount()
6522 ext4_abort(sb, ESHUTDOWN, "Abort forced by user"); in __ext4_remount()
6524 sb->s_flags = (sb->s_flags & ~SB_POSIXACL) | in __ext4_remount()
6525 (test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0); in __ext4_remount()
6530 ext4_init_journal_params(sb, sbi->s_journal); in __ext4_remount()
6537 if ((bool)(fc->sb_flags & SB_RDONLY) != sb_rdonly(sb)) { in __ext4_remount()
6538 if (ext4_forced_shutdown(sb)) { in __ext4_remount()
6544 err = sync_filesystem(sb); in __ext4_remount()
6547 err = dquot_suspend(sb, -1); in __ext4_remount()
6555 sb->s_flags |= SB_RDONLY; in __ext4_remount()
6571 ext4_mark_recovery_complete(sb, es); in __ext4_remount()
6575 if (ext4_has_feature_readonly(sb) || in __ext4_remount()
6576 !ext4_feature_set_ok(sb, 0)) { in __ext4_remount()
6586 ext4_get_group_desc(sb, g, NULL); in __ext4_remount()
6588 if (!ext4_group_desc_csum_verify(sb, g, gdp)) { in __ext4_remount()
6589 ext4_msg(sb, KERN_ERR, in __ext4_remount()
6591 g, le16_to_cpu(ext4_group_desc_csum(sb, g, gdp)), in __ext4_remount()
6603 if (es->s_last_orphan || !ext4_orphan_file_empty(sb)) { in __ext4_remount()
6604 ext4_msg(sb, KERN_WARNING, "Couldn't " in __ext4_remount()
6619 err = ext4_clear_journal_err(sb, es); in __ext4_remount()
6626 err = ext4_setup_super(sb, es, 0); in __ext4_remount()
6630 sb->s_flags &= ~SB_RDONLY; in __ext4_remount()
6631 if (ext4_has_feature_mmp(sb)) { in __ext4_remount()
6632 err = ext4_multi_mount_protect(sb, in __ext4_remount()
6648 if (test_opt(sb, BLOCK_VALIDITY) && !sbi->s_system_blks) { in __ext4_remount()
6649 err = ext4_setup_system_zone(sb); in __ext4_remount()
6655 err = ext4_commit_super(sb); in __ext4_remount()
6662 if (sb_any_quota_suspended(sb)) in __ext4_remount()
6663 dquot_resume(sb, -1); in __ext4_remount()
6664 else if (ext4_has_feature_quota(sb)) { in __ext4_remount()
6665 err = ext4_enable_quotas(sb); in __ext4_remount()
6674 if (!test_opt(sb, BLOCK_VALIDITY) && sbi->s_system_blks) in __ext4_remount()
6675 ext4_release_system_zone(sb); in __ext4_remount()
6681 if (sb_rdonly(sb) || !test_opt(sb, INIT_INODE_TABLE)) in __ext4_remount()
6682 ext4_unregister_li_request(sb); in __ext4_remount()
6685 first_not_zeroed = ext4_has_uninit_itable(sb); in __ext4_remount()
6686 ext4_register_li_request(sb, first_not_zeroed); in __ext4_remount()
6689 if (!ext4_has_feature_mmp(sb) || sb_rdonly(sb)) in __ext4_remount()
6699 if (sb_rdonly(sb) && !(old_sb_flags & SB_RDONLY) && in __ext4_remount()
6700 sb_any_quota_suspended(sb)) in __ext4_remount()
6701 dquot_resume(sb, -1); in __ext4_remount()
6703 alloc_ctx = ext4_writepages_down_write(sb); in __ext4_remount()
6704 sb->s_flags = old_sb_flags; in __ext4_remount()
6712 ext4_writepages_up_write(sb, alloc_ctx); in __ext4_remount()
6714 if (!test_opt(sb, BLOCK_VALIDITY) && sbi->s_system_blks) in __ext4_remount()
6715 ext4_release_system_zone(sb); in __ext4_remount()
6719 to_free[i] = get_qf_name(sb, sbi, i); in __ext4_remount()
6726 if (!ext4_has_feature_mmp(sb) || sb_rdonly(sb)) in __ext4_remount()
6733 struct super_block *sb = fc->root->d_sb; in ext4_reconfigure() local
6736 fc->s_fs_info = EXT4_SB(sb); in ext4_reconfigure()
6738 ret = ext4_check_opt_consistency(fc, sb); in ext4_reconfigure()
6742 ret = __ext4_remount(fc, sb); in ext4_reconfigure()
6746 ext4_msg(sb, KERN_INFO, "re-mounted %pU %s. Quota mode: %s.", in ext4_reconfigure()
6747 &sb->s_uuid, sb_rdonly(sb) ? "ro" : "r/w", in ext4_reconfigure()
6748 ext4_quota_mode(sb)); in ext4_reconfigure()
6754 static int ext4_statfs_project(struct super_block *sb, in ext4_statfs_project() argument
6763 dquot = dqget(sb, qid); in ext4_statfs_project()
6770 limit >>= sb->s_blocksize_bits; in ext4_statfs_project()
6774 dquot->dq_dqb.dqb_rsvspace) >> sb->s_blocksize_bits; in ext4_statfs_project()
6798 struct super_block *sb = dentry->d_sb; in ext4_statfs() local
6799 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_statfs()
6805 if (!test_opt(sb, MINIX_DF)) in ext4_statfs()
6809 buf->f_bsize = sb->s_blocksize; in ext4_statfs()
6826 sb_has_quota_limits_enabled(sb, PRJQUOTA)) in ext4_statfs()
6827 ext4_statfs_project(sb, EXT4_I(dentry->d_inode)->i_projid, buf); in ext4_statfs()
6911 struct super_block *sb = dquot->dq_sb; in ext4_mark_dquot_dirty() local
6913 if (ext4_is_quota_journalled(sb)) { in ext4_mark_dquot_dirty()
6921 static int ext4_write_info(struct super_block *sb, int type) in ext4_write_info() argument
6927 handle = ext4_journal_start_sb(sb, EXT4_HT_QUOTA, 2); in ext4_write_info()
6930 ret = dquot_commit_info(sb, type); in ext4_write_info()
6954 static int ext4_quota_on(struct super_block *sb, int type, int format_id, in ext4_quota_on() argument
6959 if (!test_opt(sb, QUOTA)) in ext4_quota_on()
6963 if (path->dentry->d_sb != sb) in ext4_quota_on()
6971 if (EXT4_SB(sb)->s_qf_names[type]) { in ext4_quota_on()
6973 if (path->dentry->d_parent != sb->s_root) in ext4_quota_on()
6974 ext4_msg(sb, KERN_WARNING, in ext4_quota_on()
6977 sb_dqopt(sb)->flags |= DQUOT_NOLIST_DIRTY; in ext4_quota_on()
6983 sb_dqopt(sb)->flags &= ~DQUOT_NOLIST_DIRTY; in ext4_quota_on()
6987 err = dquot_quota_on(sb, type, format_id, path); in ext4_quota_on()
7009 dquot_quota_off(sb, type); in ext4_quota_on()
7031 static int ext4_quota_enable(struct super_block *sb, int type, int format_id, in ext4_quota_enable() argument
7037 le32_to_cpu(EXT4_SB(sb)->s_es->s_usr_quota_inum), in ext4_quota_enable()
7038 le32_to_cpu(EXT4_SB(sb)->s_es->s_grp_quota_inum), in ext4_quota_enable()
7039 le32_to_cpu(EXT4_SB(sb)->s_es->s_prj_quota_inum) in ext4_quota_enable()
7042 BUG_ON(!ext4_has_feature_quota(sb)); in ext4_quota_enable()
7048 ext4_error(sb, "Bad quota inum: %lu, type: %d", in ext4_quota_enable()
7053 qf_inode = ext4_iget(sb, qf_inums[type], EXT4_IGET_SPECIAL); in ext4_quota_enable()
7055 ext4_error(sb, "Bad quota inode: %lu, type: %d", in ext4_quota_enable()
7072 int ext4_enable_quotas(struct super_block *sb) in ext4_enable_quotas() argument
7076 le32_to_cpu(EXT4_SB(sb)->s_es->s_usr_quota_inum), in ext4_enable_quotas()
7077 le32_to_cpu(EXT4_SB(sb)->s_es->s_grp_quota_inum), in ext4_enable_quotas()
7078 le32_to_cpu(EXT4_SB(sb)->s_es->s_prj_quota_inum) in ext4_enable_quotas()
7081 test_opt(sb, USRQUOTA), in ext4_enable_quotas()
7082 test_opt(sb, GRPQUOTA), in ext4_enable_quotas()
7083 test_opt(sb, PRJQUOTA), in ext4_enable_quotas()
7086 sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE | DQUOT_NOLIST_DIRTY; in ext4_enable_quotas()
7089 err = ext4_quota_enable(sb, type, QFMT_VFS_V1, in ext4_enable_quotas()
7093 ext4_warning(sb, in ext4_enable_quotas()
7099 ext4_quotas_off(sb, type); in ext4_enable_quotas()
7107 static int ext4_quota_off(struct super_block *sb, int type) in ext4_quota_off() argument
7109 struct inode *inode = sb_dqopt(sb)->files[type]; in ext4_quota_off()
7115 if (test_opt(sb, DELALLOC)) in ext4_quota_off()
7116 sync_filesystem(sb); in ext4_quota_off()
7121 err = dquot_quota_off(sb, type); in ext4_quota_off()
7122 if (err || ext4_has_feature_quota(sb)) in ext4_quota_off()
7129 if (sb_rdonly(sb)) in ext4_quota_off()
7155 return dquot_quota_off(sb, type); in ext4_quota_off()
7162 static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, in ext4_quota_read() argument
7165 struct inode *inode = sb_dqopt(sb)->files[type]; in ext4_quota_read()
7166 ext4_lblk_t blk = off >> EXT4_BLOCK_SIZE_BITS(sb); in ext4_quota_read()
7167 int offset = off & (sb->s_blocksize - 1); in ext4_quota_read()
7179 tocopy = min_t(unsigned long, sb->s_blocksize - offset, toread); in ext4_quota_read()
7198 static ssize_t ext4_quota_write(struct super_block *sb, int type, in ext4_quota_write() argument
7201 struct inode *inode = sb_dqopt(sb)->files[type]; in ext4_quota_write()
7202 ext4_lblk_t blk = off >> EXT4_BLOCK_SIZE_BITS(sb); in ext4_quota_write()
7203 int err = 0, err2 = 0, offset = off & (sb->s_blocksize - 1); in ext4_quota_write()
7209 ext4_msg(sb, KERN_WARNING, "Quota write (off=%llu, len=%llu)" in ext4_quota_write()
7218 if (sb->s_blocksize - offset < len) { in ext4_quota_write()
7219 ext4_msg(sb, KERN_WARNING, "Quota write (off=%llu, len=%llu)" in ext4_quota_write()
7236 err = ext4_journal_get_write_access(handle, sb, bh, EXT4_JTR_NONE); in ext4_quota_write()
7273 static inline int ext2_feature_set_ok(struct super_block *sb) in ext2_feature_set_ok() argument
7275 if (ext4_has_unknown_ext2_incompat_features(sb)) in ext2_feature_set_ok()
7277 if (sb_rdonly(sb)) in ext2_feature_set_ok()
7279 if (ext4_has_unknown_ext2_ro_compat_features(sb)) in ext2_feature_set_ok()
7286 static inline int ext2_feature_set_ok(struct super_block *sb) { return 0; } in ext2_feature_set_ok() argument
7302 static inline int ext3_feature_set_ok(struct super_block *sb) in ext3_feature_set_ok() argument
7304 if (ext4_has_unknown_ext3_incompat_features(sb)) in ext3_feature_set_ok()
7306 if (!ext4_has_feature_journal(sb)) in ext3_feature_set_ok()
7308 if (sb_rdonly(sb)) in ext3_feature_set_ok()
7310 if (ext4_has_unknown_ext3_ro_compat_features(sb)) in ext3_feature_set_ok()
7315 static void ext4_kill_sb(struct super_block *sb) in ext4_kill_sb() argument
7317 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_kill_sb()
7320 kill_block_super(sb); in ext4_kill_sb()