Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f636d300 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xfs-4.18-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:

 - Fix some uninitialized variable errors

 - Fix an incorrect check in metadata verifiers

* tag 'xfs-4.18-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: properly handle free inodes in extent hint validators
  xfs: Initialize variables in xfs_alloc_get_rec before using them
parents cd3f77d7 d4a34e16
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -223,12 +223,13 @@ xfs_alloc_get_rec(
	error = xfs_btree_get_rec(cur, &rec, stat);
	if (error || !(*stat))
		return error;
	if (rec->alloc.ar_blockcount == 0)
		goto out_bad_rec;

	*bno = be32_to_cpu(rec->alloc.ar_startblock);
	*len = be32_to_cpu(rec->alloc.ar_blockcount);

	if (*len == 0)
		goto out_bad_rec;

	/* check for valid extent range, including overflow */
	if (!xfs_verify_agbno(mp, agno, *bno))
		goto out_bad_rec;
+4 −2
Original line number Diff line number Diff line
@@ -731,7 +731,8 @@ xfs_inode_validate_extsize(
	if ((hint_flag || inherit_flag) && extsize == 0)
		return __this_address;

	if (!(hint_flag || inherit_flag) && extsize != 0)
	/* free inodes get flags set to zero but extsize remains */
	if (mode && !(hint_flag || inherit_flag) && extsize != 0)
		return __this_address;

	if (extsize_bytes % blocksize_bytes)
@@ -777,7 +778,8 @@ xfs_inode_validate_cowextsize(
	if (hint_flag && cowextsize == 0)
		return __this_address;

	if (!hint_flag && cowextsize != 0)
	/* free inodes get flags set to zero but cowextsize remains */
	if (mode && !hint_flag && cowextsize != 0)
		return __this_address;

	if (hint_flag && rt_flag)