Commit ad64c342 authored by Dave Chinner's avatar Dave Chinner Committed by openeuler-sync-bot
Browse files

xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown

mainline inclusion
from mainline-v5.14-rc4
commit 75c8c50f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4KIAO
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75c8c50fa16a23f8ac89ea74834ae8ddd1558d75



--------------------------------

Remove the shouty macro and instead use the inline function that
matches other state/feature check wrapper naming. This conversion
was done with sed.

Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>

Conflicts:
	fs/xfs/libxfs/xfs_btree.c
	fs/xfs/libxfs/xfs_ialloc.c
	fs/xfs/xfs_aops.c
	fs/xfs/xfs_bmap_util.c
	fs/xfs/xfs_buf.c
	fs/xfs/xfs_buf_item.c
	fs/xfs/xfs_icache.c
	fs/xfs/xfs_inode.c
	fs/xfs/xfs_mount.c
	fs/xfs/xfs_qm.c

Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
(cherry picked from commit ecf40de9)
parent 89331aee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3029,7 +3029,7 @@ xfs_alloc_read_agf(
			atomic64_add(allocbt_blks, &mp->m_allocbt_blks);
	}
#ifdef DEBUG
	else if (!XFS_FORCED_SHUTDOWN(mp)) {
	else if (!xfs_is_shutdown(mp)) {
		ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks));
		ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks));
		ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount));
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ xfs_attr_get(

	XFS_STATS_INC(args->dp->i_mount, xs_attr_get);

	if (XFS_FORCED_SHUTDOWN(args->dp->i_mount))
	if (xfs_is_shutdown(args->dp->i_mount))
		return -EIO;

	args->geo = args->dp->i_mount->m_attr_geo;
@@ -400,7 +400,7 @@ xfs_attr_set(
	int			rmt_blks = 0;
	unsigned int		total;

	if (XFS_FORCED_SHUTDOWN(dp->i_mount))
	if (xfs_is_shutdown(dp->i_mount))
		return -EIO;

	error = xfs_qm_dqattach(dp);
+8 −8
Original line number Diff line number Diff line
@@ -3881,7 +3881,7 @@ xfs_bmapi_read(
	    XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT))
		return -EFSCORRUPTED;

	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	XFS_STATS_INC(mp, xs_blk_mapr);
@@ -4356,7 +4356,7 @@ xfs_bmapi_write(
		return -EFSCORRUPTED;
	}

	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	XFS_STATS_INC(mp, xs_blk_mapw);
@@ -4641,7 +4641,7 @@ xfs_bmapi_remap(
		return -EFSCORRUPTED;
	}

	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	if (!(ifp->if_flags & XFS_IFEXTENTS)) {
@@ -5301,7 +5301,7 @@ __xfs_bunmapi(
	ifp = xfs_ifork_ptr(ip, whichfork);
	if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)))
		return -EFSCORRUPTED;
	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
@@ -5791,7 +5791,7 @@ xfs_bmap_collapse_extents(
		return -EFSCORRUPTED;
	}

	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@@ -5871,7 +5871,7 @@ xfs_bmap_can_insert_extents(

	ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));

	if (XFS_FORCED_SHUTDOWN(ip->i_mount))
	if (xfs_is_shutdown(ip->i_mount))
		return -EIO;

	xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -5908,7 +5908,7 @@ xfs_bmap_insert_extents(
		return -EFSCORRUPTED;
	}

	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@@ -6013,7 +6013,7 @@ xfs_bmap_split_extent(
		return -EFSCORRUPTED;
	}

	if (XFS_FORCED_SHUTDOWN(mp))
	if (xfs_is_shutdown(mp))
		return -EIO;

	if (!(ifp->if_flags & XFS_IFEXTENTS)) {
+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ xfs_btree_del_cursor(
	 * cancelling a dirty transaction on error.
	 */
	ASSERT(cur->bc_btnum != XFS_BTNUM_BMAP || cur->bc_ino.allocated == 0 ||
	       XFS_FORCED_SHUTDOWN(cur->bc_mp) || error != 0);
	       xfs_is_shutdown(cur->bc_mp) || error != 0);
	if (unlikely(cur->bc_flags & XFS_BTREE_STAGING))
		kmem_free(cur->bc_ops);
	kmem_cache_free(xfs_btree_cur_zone, cur);
+3 −3
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ xfs_check_agi_freecount(
			}
		} while (i == 1);

		if (!XFS_FORCED_SHUTDOWN(cur->bc_mp))
		if (!xfs_is_shutdown(cur->bc_mp))
			ASSERT(freecount == be32_to_cpu(agi->agi_freecount));
	}
	return 0;
@@ -1027,7 +1027,7 @@ xfs_ialloc_ag_select(
		 * No point in iterating over the rest, if we're shutting
		 * down.
		 */
		if (XFS_FORCED_SHUTDOWN(mp))
		if (xfs_is_shutdown(mp))
			return NULLAGNUMBER;
		agno++;
		if (agno >= agcount)
@@ -2659,7 +2659,7 @@ xfs_ialloc_read_agi(
	 * we are in the middle of a forced shutdown.
	 */
	ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) ||
		XFS_FORCED_SHUTDOWN(mp));
		xfs_is_shutdown(mp));
	return 0;
}

Loading