linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kangjie Lu <kjlu@umn.edu>
To: kjlu@umn.edu
Cc: pakki001@umn.edu, "Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] xfs: add a check for xfs_trans_commit
Date: Wed, 26 Dec 2018 00:05:16 -0600	[thread overview]
Message-ID: <20181226060516.75103-1-kjlu@umn.edu> (raw)

xfs_trans_commit could fails. The checks issues an error message upon
its failure.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 fs/xfs/xfs_super.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index d3e6cd063688..8ec2e3c8e946 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1010,6 +1010,7 @@ xfs_fs_dirty_inode(
 	struct xfs_inode		*ip = XFS_I(inode);
 	struct xfs_mount		*mp = ip->i_mount;
 	struct xfs_trans		*tp;
+	int error;
 
 	if (!(inode->i_sb->s_flags & SB_LAZYTIME))
 		return;
@@ -1021,7 +1022,10 @@ xfs_fs_dirty_inode(
 	xfs_ilock(ip, XFS_ILOCK_EXCL);
 	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP);
-	xfs_trans_commit(tp);
+	error = xfs_trans_commit(tp);
+	if (error)
+		xfs_err(mp,
+				"Error in xfs_trans_commit: %d\n", error);
 }
 
 /*
-- 
2.17.2 (Apple Git-113)

             reply	other threads:[~2018-12-26  6:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26  6:05 Kangjie Lu [this message]
2018-12-27  8:07 ` [PATCH] xfs: add a check for xfs_trans_commit Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181226060516.75103-1-kjlu@umn.edu \
    --to=kjlu@umn.edu \
    --cc=darrick.wong@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).