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

Commit 1b0350c3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'xfs-fixes-for-4.19-rc6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Dave writes:
  "XFS fixes for 4.19-rc6

   Accumlated regression and bug fixes for 4.19-rc6, including:

   o make iomap correctly mark dirty pages for sub-page block sizes
   o fix regression in handling extent-to-btree format conversion errors
   o fix torn log wrap detection for new logs
   o various corrupt inode detection fixes
   o various delalloc state fixes
   o cleanup all the missed transaction cancel cases missed from changes merged
     in 4.19-rc1
   o fix lockdep false positive on transaction allocation
   o fix locking and reference counting on buffer log items"

* tag 'xfs-fixes-for-4.19-rc6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: fix error handling in xfs_bmap_extents_to_btree
  iomap: set page dirty after partial delalloc on mkwrite
  xfs: remove invalid log recovery first/last cycle check
  xfs: validate inode di_forkoff
  xfs: skip delalloc COW blocks in xfs_reflink_end_cow
  xfs: don't treat unknown di_flags2 as corruption in scrub
  xfs: remove duplicated include from alloc.c
  xfs: don't bring in extents in xfs_bmap_punch_delalloc_range
  xfs: fix transaction leak in xfs_reflink_allocate_cow()
  xfs: avoid lockdep false positives in xfs_trans_alloc
  xfs: refactor xfs_buf_log_item reference count handling
  xfs: clean up xfs_trans_brelse()
  xfs: don't unlock invalidated buf on aborted tx commit
  xfs: remove last of unnecessary xfs_defer_cancel() callers
  xfs: don't crash the vfs on a garbage inline symlink
parents d2467adb e55ec4dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1051,6 +1051,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length,
	} else {
		WARN_ON_ONCE(!PageUptodate(page));
		iomap_page_create(inode, page);
		set_page_dirty(page);
	}

	return length;
@@ -1090,7 +1091,6 @@ int iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
		length -= ret;
	}

	set_page_dirty(page);
	wait_for_stable_page(page);
	return VM_FAULT_LOCKED;
out_unlock:
+8 −20
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ xfs_attr_leaf_addname(
		 */
		error = xfs_attr3_leaf_to_node(args);
		if (error)
			goto out_defer_cancel;
			return error;
		error = xfs_defer_finish(&args->trans);
		if (error)
			return error;
@@ -675,7 +675,7 @@ xfs_attr_leaf_addname(
			error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
			/* bp is gone due to xfs_da_shrink_inode */
			if (error)
				goto out_defer_cancel;
				return error;
			error = xfs_defer_finish(&args->trans);
			if (error)
				return error;
@@ -693,9 +693,6 @@ xfs_attr_leaf_addname(
		error = xfs_attr3_leaf_clearflag(args);
	}
	return error;
out_defer_cancel:
	xfs_defer_cancel(args->trans);
	return error;
}

/*
@@ -738,15 +735,12 @@ xfs_attr_leaf_removename(
		error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
		/* bp is gone due to xfs_da_shrink_inode */
		if (error)
			goto out_defer_cancel;
			return error;
		error = xfs_defer_finish(&args->trans);
		if (error)
			return error;
	}
	return 0;
out_defer_cancel:
	xfs_defer_cancel(args->trans);
	return error;
}

/*
@@ -864,7 +858,7 @@ xfs_attr_node_addname(
			state = NULL;
			error = xfs_attr3_leaf_to_node(args);
			if (error)
				goto out_defer_cancel;
				goto out;
			error = xfs_defer_finish(&args->trans);
			if (error)
				goto out;
@@ -888,7 +882,7 @@ xfs_attr_node_addname(
		 */
		error = xfs_da3_split(state);
		if (error)
			goto out_defer_cancel;
			goto out;
		error = xfs_defer_finish(&args->trans);
		if (error)
			goto out;
@@ -984,7 +978,7 @@ xfs_attr_node_addname(
		if (retval && (state->path.active > 1)) {
			error = xfs_da3_join(state);
			if (error)
				goto out_defer_cancel;
				goto out;
			error = xfs_defer_finish(&args->trans);
			if (error)
				goto out;
@@ -1013,9 +1007,6 @@ xfs_attr_node_addname(
	if (error)
		return error;
	return retval;
out_defer_cancel:
	xfs_defer_cancel(args->trans);
	goto out;
}

/*
@@ -1107,7 +1098,7 @@ xfs_attr_node_removename(
	if (retval && (state->path.active > 1)) {
		error = xfs_da3_join(state);
		if (error)
			goto out_defer_cancel;
			goto out;
		error = xfs_defer_finish(&args->trans);
		if (error)
			goto out;
@@ -1138,7 +1129,7 @@ xfs_attr_node_removename(
			error = xfs_attr3_leaf_to_shortform(bp, args, forkoff);
			/* bp is gone due to xfs_da_shrink_inode */
			if (error)
				goto out_defer_cancel;
				goto out;
			error = xfs_defer_finish(&args->trans);
			if (error)
				goto out;
@@ -1150,9 +1141,6 @@ xfs_attr_node_removename(
out:
	xfs_da_state_free(state);
	return error;
out_defer_cancel:
	xfs_defer_cancel(args->trans);
	goto out;
}

/*
+2 −8
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ xfs_attr_rmtval_set(
				  blkcnt, XFS_BMAPI_ATTRFORK, args->total, &map,
				  &nmap);
		if (error)
			goto out_defer_cancel;
			return error;
		error = xfs_defer_finish(&args->trans);
		if (error)
			return error;
@@ -553,9 +553,6 @@ xfs_attr_rmtval_set(
	}
	ASSERT(valuelen == 0);
	return 0;
out_defer_cancel:
	xfs_defer_cancel(args->trans);
	return error;
}

/*
@@ -625,7 +622,7 @@ xfs_attr_rmtval_remove(
		error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
				    XFS_BMAPI_ATTRFORK, 1, &done);
		if (error)
			goto out_defer_cancel;
			return error;
		error = xfs_defer_finish(&args->trans);
		if (error)
			return error;
@@ -638,7 +635,4 @@ xfs_attr_rmtval_remove(
			return error;
	}
	return 0;
out_defer_cancel:
	xfs_defer_cancel(args->trans);
	return error;
}
+13 −11
Original line number Diff line number Diff line
@@ -673,7 +673,8 @@ xfs_bmap_extents_to_btree(
	ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS);

	/*
	 * Make space in the inode incore.
	 * Make space in the inode incore. This needs to be undone if we fail
	 * to expand the root.
	 */
	xfs_iroot_realloc(ip, 1, whichfork);
	ifp->if_flags |= XFS_IFBROOT;
@@ -711,16 +712,15 @@ xfs_bmap_extents_to_btree(
	args.minlen = args.maxlen = args.prod = 1;
	args.wasdel = wasdel;
	*logflagsp = 0;
	if ((error = xfs_alloc_vextent(&args))) {
		ASSERT(ifp->if_broot == NULL);
		goto err1;
	}
	error = xfs_alloc_vextent(&args);
	if (error)
		goto out_root_realloc;

	if (WARN_ON_ONCE(args.fsbno == NULLFSBLOCK)) {
		ASSERT(ifp->if_broot == NULL);
		error = -ENOSPC;
		goto err1;
		goto out_root_realloc;
	}

	/*
	 * Allocation can't fail, the space was reserved.
	 */
@@ -732,9 +732,10 @@ xfs_bmap_extents_to_btree(
	xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L);
	abp = xfs_btree_get_bufl(mp, tp, args.fsbno, 0);
	if (!abp) {
		error = -ENOSPC;
		goto err2;
		error = -EFSCORRUPTED;
		goto out_unreserve_dquot;
	}

	/*
	 * Fill in the child block.
	 */
@@ -775,11 +776,12 @@ xfs_bmap_extents_to_btree(
	*logflagsp = XFS_ILOG_CORE | xfs_ilog_fbroot(whichfork);
	return 0;

err2:
out_unreserve_dquot:
	xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
err1:
out_root_realloc:
	xfs_iroot_realloc(ip, -1, whichfork);
	XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS);
	ASSERT(ifp->if_broot == NULL);
	xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);

	return error;
+2 −0
Original line number Diff line number Diff line
@@ -1016,6 +1016,8 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
#define XFS_DIFLAG_EXTSZINHERIT_BIT 12	/* inherit inode extent size */
#define XFS_DIFLAG_NODEFRAG_BIT     13	/* do not reorganize/defragment */
#define XFS_DIFLAG_FILESTREAM_BIT   14  /* use filestream allocator */
/* Do not use bit 15, di_flags is legacy and unchanging now */

#define XFS_DIFLAG_REALTIME      (1 << XFS_DIFLAG_REALTIME_BIT)
#define XFS_DIFLAG_PREALLOC      (1 << XFS_DIFLAG_PREALLOC_BIT)
#define XFS_DIFLAG_NEWRTBM       (1 << XFS_DIFLAG_NEWRTBM_BIT)
Loading