xfs: handle CIl transaction commit failures correctly

Failure to commit a transaction into the CIL is not handled
correctly. This currently can only happen when racing with a
shutdown and requires an explicit shutdown check, so it rare and can
be avoided. Remove the shutdown check and make the CIL commit a void
function to indicate it will always succeed, thereby removing the
incorrectly handled failure case.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>

authored by Dave Chinner and committed by Alex Elder c6f990d1 5315837d

+3 -12
+1 -1
fs/xfs/xfs_log.h
··· 191 191 192 192 xlog_tid_t xfs_log_get_trans_ident(struct xfs_trans *tp); 193 193 194 - int xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp, 194 + void xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp, 195 195 struct xfs_log_vec *log_vector, 196 196 xfs_lsn_t *commit_lsn, int flags); 197 197 bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
+1 -7
fs/xfs/xfs_log_cil.c
··· 625 625 * background commit, returns without it held once background commits are 626 626 * allowed again. 627 627 */ 628 - int 628 + void 629 629 xfs_log_commit_cil( 630 630 struct xfs_mount *mp, 631 631 struct xfs_trans *tp, ··· 639 639 640 640 if (flags & XFS_TRANS_RELEASE_LOG_RES) 641 641 log_flags = XFS_LOG_REL_PERM_RESERV; 642 - 643 - if (XLOG_FORCED_SHUTDOWN(log)) { 644 - xlog_cil_free_logvec(log_vector); 645 - return XFS_ERROR(EIO); 646 - } 647 642 648 643 /* 649 644 * do all the hard work of formatting items (including memory ··· 699 704 */ 700 705 if (push) 701 706 xlog_cil_push(log, 0); 702 - return 0; 703 707 } 704 708 705 709 /*
+1 -4
fs/xfs/xfs_trans.c
··· 1755 1755 int flags) 1756 1756 { 1757 1757 struct xfs_log_vec *log_vector; 1758 - int error; 1759 1758 1760 1759 /* 1761 1760 * Get each log item to allocate a vector structure for ··· 1765 1766 if (!log_vector) 1766 1767 return ENOMEM; 1767 1768 1768 - error = xfs_log_commit_cil(mp, tp, log_vector, commit_lsn, flags); 1769 - if (error) 1770 - return error; 1769 + xfs_log_commit_cil(mp, tp, log_vector, commit_lsn, flags); 1771 1770 1772 1771 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS); 1773 1772 xfs_trans_free(tp);