Commit 399af662 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull xfs fixes from Carlos Maiolino:
 "A couple race fixes found on the new healthmon mechanism, and another
  flushing dquots during filesystem shutdown"

* tag 'xfs-fixes-7.0-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: fix integer overflow in bmap intent sort comparator
  xfs: fix undersized l_iclog_roundoff values
  xfs: ensure dquot item is deleted from AIL only after log shutdown
  xfs: remove redundant set null for ip->i_itemp
  xfs: fix returned valued from xfs_defer_can_append
  xfs: Remove redundant NULL check after __GFP_NOFAIL
  xfs: fix race between healthmon unmount and read_iter
  xfs: remove scratch field from struct xfs_gc_bio
parents d874ca05 362c4909
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -2716,12 +2716,8 @@ xfs_dabuf_map(
	 * larger one that needs to be free by the caller.
	 */
	if (nirecs > 1) {
		map = kzalloc(nirecs * sizeof(struct xfs_buf_map),
		map = kcalloc(nirecs, sizeof(struct xfs_buf_map),
			      GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL);
		if (!map) {
			error = -ENOMEM;
			goto out_free_irecs;
		}
		*mapp = map;
	}

+1 −1
Original line number Diff line number Diff line
@@ -809,7 +809,7 @@ xfs_defer_can_append(

	/* Paused items cannot absorb more work */
	if (dfp->dfp_flags & XFS_DEFER_PAUSED)
		return NULL;
		return false;

	/* Already full? */
	if (ops->max_items && dfp->dfp_count >= ops->max_items)
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ xfs_bmap_update_diff_items(
	struct xfs_bmap_intent		*ba = bi_entry(a);
	struct xfs_bmap_intent		*bb = bi_entry(b);

	return ba->bi_owner->i_ino - bb->bi_owner->i_ino;
	return cmp_int(ba->bi_owner->i_ino, bb->bi_owner->i_ino);
}

/* Log bmap updates in the intent item. */
+7 −1
Original line number Diff line number Diff line
@@ -1439,9 +1439,15 @@ xfs_qm_dqflush(
	return 0;

out_abort:
	/*
	 * Shut down the log before removing the dquot item from the AIL.
	 * Otherwise, the log tail may advance past this item's LSN while
	 * log writes are still in progress, making these unflushed changes
	 * unrecoverable on the next mount.
	 */
	xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
	dqp->q_flags &= ~XFS_DQFLAG_DIRTY;
	xfs_trans_ail_delete(lip, 0);
	xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
	xfs_dqfunlock(dqp);
	return error;
}
+10 −7
Original line number Diff line number Diff line
@@ -141,6 +141,16 @@ xfs_healthmon_detach(
	hm->mount_cookie = DETACHED_MOUNT_COOKIE;
	spin_unlock(&xfs_healthmon_lock);

	/*
	 * Wake up any readers that might remain.  This can happen if unmount
	 * races with the healthmon fd owner entering ->read_iter, having
	 * already emptied the event queue.
	 *
	 * In the ->release case there shouldn't be any readers because the
	 * only users of the waiter are read and poll.
	 */
	wake_up_all(&hm->wait);

	trace_xfs_healthmon_detach(hm);
	xfs_healthmon_put(hm);
}
@@ -1027,13 +1037,6 @@ xfs_healthmon_release(
	 * process can create another health monitor file.
	 */
	xfs_healthmon_detach(hm);

	/*
	 * Wake up any readers that might be left.  There shouldn't be any
	 * because the only users of the waiter are read and poll.
	 */
	wake_up_all(&hm->wait);

	xfs_healthmon_put(hm);
	return 0;
}
Loading