Unverified Commit 32613ac5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1272 xfs: fix some problems recently

Merge Pull Request from: @ci-robot 
 
PR sync from: Long Li <leo.lilong@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/W6KN2XSLJE5HZR2Y5D2OTDQ2GTLDGC5O/ 
Patchs 1-6 fix some problems recently.
Patchs 7-8 backport from mainline.

Darrick J. Wong (1):
  xfs: fix uninitialized variable access

Dave Chinner (1):
  xfs: set XFS_FEAT_NLINK correctly

Long Li (4):
  xfs: factor out xfs_defer_pending_abort
  xfs: don't leak intent item when recovery intents fail
  xfs: factor out xfs_destroy_perag()
  xfs: don't leak perag when growfs fails

Ye Bin (1):
  xfs: fix warning in xfs_vm_writepages()

yangerkun (1):
  xfs: fix mounting failed caused by sequencing problem in the log
    records


-- 
2.31.1
 
 
Link:https://gitee.com/openeuler/kernel/pulls/1272

 

Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents d98de1d6 aebc38d3
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -210,21 +210,18 @@ xfs_defer_create_intents(
	}
}

/* Abort all the intents that were committed. */
STATIC void
xfs_defer_trans_abort(
	struct xfs_trans		*tp,
	struct list_head		*dop_pending)
void
xfs_defer_pending_abort(
	struct xfs_mount		*mp,
	struct list_head		*dop_list)
{
	struct xfs_defer_pending	*dfp;
	const struct xfs_defer_op_type	*ops;

	trace_xfs_defer_trans_abort(tp, _RET_IP_);

	/* Abort intent items that don't have a done item. */
	list_for_each_entry(dfp, dop_pending, dfp_list) {
	list_for_each_entry(dfp, dop_list, dfp_list) {
		ops = defer_op_types[dfp->dfp_type];
		trace_xfs_defer_pending_abort(tp->t_mountp, dfp);
		trace_xfs_defer_pending_abort(mp, dfp);
		if (dfp->dfp_intent && !dfp->dfp_done) {
			ops->abort_intent(dfp->dfp_intent);
			dfp->dfp_intent = NULL;
@@ -232,6 +229,16 @@ xfs_defer_trans_abort(
	}
}

/* Abort all the intents that were committed. */
STATIC void
xfs_defer_trans_abort(
	struct xfs_trans		*tp,
	struct list_head		*dop_pending)
{
	trace_xfs_defer_trans_abort(tp, _RET_IP_);
	xfs_defer_pending_abort(tp->t_mountp, dop_pending);
}

/* Roll a transaction so we can do some deferred op processing. */
STATIC int
xfs_defer_trans_roll(
@@ -706,6 +713,7 @@ xfs_defer_ops_capture_and_commit(
	/* Commit the transaction and add the capture structure to the list. */
	error = xfs_trans_commit(tp);
	if (error) {
		xfs_defer_pending_abort(mp, &dfc->dfc_dfops);
		xfs_defer_ops_release(mp, dfc);
		return error;
	}
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ struct xfs_defer_pending {
	enum xfs_defer_ops_type		dfp_type;
};

void xfs_defer_pending_abort(struct xfs_mount *mp, struct list_head *dop_list);
void xfs_defer_add(struct xfs_trans *tp, enum xfs_defer_ops_type type,
		struct list_head *h);
int xfs_defer_finish_noroll(struct xfs_trans **tp);
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ enum xlog_recover_reorder {
	XLOG_REORDER_ITEM_LIST,
	XLOG_REORDER_INODE_BUFFER_LIST,
	XLOG_REORDER_CANCEL_LIST,
	XLOG_REORDER_SB_BUFFER_LIST,
};

struct xlog_recover_item_ops {
+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ xfs_sb_version_to_features(
	/* optional V4 features */
	if (sbp->sb_rblocks > 0)
		features |= XFS_FEAT_REALTIME;
	if (sbp->sb_versionnum & XFS_SB_VERSION_NLINKBIT)
		features |= XFS_FEAT_NLINK;
	if (sbp->sb_versionnum & XFS_SB_VERSION_ATTRBIT)
		features |= XFS_FEAT_ATTR;
	if (sbp->sb_versionnum & XFS_SB_VERSION_QUOTABIT)
+2 −0
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@ xlog_recover_buf_reorder(
		return XLOG_REORDER_CANCEL_LIST;
	if (buf_f->blf_flags & XFS_BLF_INODE_BUF)
		return XLOG_REORDER_INODE_BUFFER_LIST;
	if (buf_f->blf_blkno == XFS_SB_DADDR)
		return XLOG_REORDER_SB_BUFFER_LIST;
	return XLOG_REORDER_BUFFER_LIST;
}

Loading