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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user