Commit 5c2a430e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'ext4-for_linus-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 updates from Ted Ts'o:
 "Ext4 bug fixes and cleanups, including:

   - hardening against maliciously fuzzed file systems

   - backwards compatibility for the brief period when we attempted to
     ignore zero-width characters

   - avoid potentially BUG'ing if there is a file system corruption
     found during the file system unmount

   - fix free space reporting by statfs when project quotas are enabled
     and the free space is less than the remaining project quota

  Also improve performance when replaying a journal with a very large
  number of revoke records (applicable for Lustre volumes)"

* tag 'ext4-for_linus-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (71 commits)
  ext4: fix OOB read when checking dotdot dir
  ext4: on a remount, only log the ro or r/w state when it has changed
  ext4: correct the error handle in ext4_fallocate()
  ext4: Make sb update interval tunable
  ext4: avoid journaling sb update on error if journal is destroying
  ext4: define ext4_journal_destroy wrapper
  ext4: hash: simplify kzalloc(n * 1, ...) to kzalloc(n, ...)
  jbd2: add a missing data flush during file and fs synchronization
  ext4: don't over-report free space or inodes in statvfs
  ext4: clear DISCARD flag if device does not support discard
  jbd2: remove jbd2_journal_unfile_buffer()
  ext4: reorder capability check last
  ext4: update the comment about mb_optimize_scan
  jbd2: fix off-by-one while erasing journal
  ext4: remove references to bh->b_page
  ext4: goto right label 'out_mmap_sem' in ext4_setattr()
  ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all()
  ext4: introduce ITAIL helper
  jbd2: remove redundant function jbd2_journal_has_csum_v2or3_feature
  ext4: remove redundant function ext4_has_metadata_csum
  ...
parents 4a4b30ea d5e20677
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -238,11 +238,10 @@ When mounting an ext4 filesystem, the following option are accepted:
        configured using tune2fs)

  data_err=ignore(*)
        Just print an error message if an error occurs in a file data buffer in
        ordered mode.
        Just print an error message if an error occurs in a file data buffer.

  data_err=abort
        Abort the journal if an error occurs in a file data buffer in ordered
        mode.
        Abort the journal if an error occurs in a file data buffer.

  grpid | bsdgroups
        New objects have the group ID of their parent.
+1 −3
Original line number Diff line number Diff line
@@ -111,9 +111,7 @@ a callback function when the transaction is finally committed to disk,
so that you can do some of your own management. You ask the journalling
layer for calling the callback by simply setting
``journal->j_commit_callback`` function pointer and that function is
called after each transaction commit. You can also use
``transaction->t_private_list`` for attaching entries to a transaction
that need processing when the transaction commits.
called after each transaction commit.

JBD2 also provides a way to block all transaction updates via
jbd2_journal_lock_updates() /
+2 −2
Original line number Diff line number Diff line
@@ -649,8 +649,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi,
	/* Hm, nope.  Are (enough) root reserved clusters available? */
	if (uid_eq(sbi->s_resuid, current_fsuid()) ||
	    (!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) && in_group_p(sbi->s_resgid)) ||
	    capable(CAP_SYS_RESOURCE) ||
	    (flags & EXT4_MB_USE_ROOT_BLOCKS)) {
	    (flags & EXT4_MB_USE_ROOT_BLOCKS) ||
	    capable(CAP_SYS_RESOURCE)) {

		if (free_clusters >= (nclusters + dirty_clusters +
				      resv_clusters))
+4 −4
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ int ext4_inode_bitmap_csum_verify(struct super_block *sb,
	struct ext4_sb_info *sbi = EXT4_SB(sb);
	int sz;

	if (!ext4_has_metadata_csum(sb))
	if (!ext4_has_feature_metadata_csum(sb))
		return 1;

	sz = EXT4_INODES_PER_GROUP(sb) >> 3;
@@ -48,7 +48,7 @@ void ext4_inode_bitmap_csum_set(struct super_block *sb,
	struct ext4_sb_info *sbi = EXT4_SB(sb);
	int sz;

	if (!ext4_has_metadata_csum(sb))
	if (!ext4_has_feature_metadata_csum(sb))
		return;

	sz = EXT4_INODES_PER_GROUP(sb) >> 3;
@@ -67,7 +67,7 @@ int ext4_block_bitmap_csum_verify(struct super_block *sb,
	struct ext4_sb_info *sbi = EXT4_SB(sb);
	int sz = EXT4_CLUSTERS_PER_GROUP(sb) / 8;

	if (!ext4_has_metadata_csum(sb))
	if (!ext4_has_feature_metadata_csum(sb))
		return 1;

	provided = le16_to_cpu(gdp->bg_block_bitmap_csum_lo);
@@ -89,7 +89,7 @@ void ext4_block_bitmap_csum_set(struct super_block *sb,
	__u32 csum;
	struct ext4_sb_info *sbi = EXT4_SB(sb);

	if (!ext4_has_metadata_csum(sb))
	if (!ext4_has_feature_metadata_csum(sb))
		return;

	csum = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)bh->b_data, sz);
+5 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ int __ext4_check_dir_entry(const char *function, unsigned int line,
						dir->i_sb->s_blocksize);
	const int next_offset = ((char *) de - buf) + rlen;
	bool fake = is_fake_dir_entry(de);
	bool has_csum = ext4_has_metadata_csum(dir->i_sb);
	bool has_csum = ext4_has_feature_metadata_csum(dir->i_sb);

	if (unlikely(rlen < ext4_dir_rec_len(1, fake ? NULL : dir)))
		error_msg = "rec_len is smaller than minimal";
@@ -104,6 +104,9 @@ int __ext4_check_dir_entry(const char *function, unsigned int line,
	else if (unlikely(le32_to_cpu(de->inode) >
			le32_to_cpu(EXT4_SB(dir->i_sb)->s_es->s_inodes_count)))
		error_msg = "inode out of bounds";
	else if (unlikely(next_offset == size && de->name_len == 1 &&
			  de->name[0] == '.'))
		error_msg = "'.' directory cannot be the last in data block";
	else
		return 0;

@@ -145,7 +148,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
			return err;

		/* Can we just clear INDEX flag to ignore htree information? */
		if (!ext4_has_metadata_csum(sb)) {
		if (!ext4_has_feature_metadata_csum(sb)) {
			/*
			 * We don't set the inode dirty flag since it's not
			 * critical that it gets flushed back to the disk.
Loading