linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: add a check for xfs_trans_commit
@ 2018-12-26  6:05 Kangjie Lu
  2018-12-27  8:07 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Kangjie Lu @ 2018-12-26  6:05 UTC (permalink / raw)
  To: kjlu; +Cc: pakki001, Darrick J. Wong, linux-xfs, linux-kernel

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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: add a check for xfs_trans_commit
  2018-12-26  6:05 [PATCH] xfs: add a check for xfs_trans_commit Kangjie Lu
@ 2018-12-27  8:07 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2018-12-27  8:07 UTC (permalink / raw)
  To: Kangjie Lu; +Cc: pakki001, Darrick J. Wong, linux-xfs, linux-kernel

On Wed, Dec 26, 2018 at 12:05:16AM -0600, Kangjie Lu wrote:
> xfs_trans_commit could fails. The checks issues an error message upon
> its failure.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Please take a close look at what could fail in xfs_trans_commit, and how
those failures are logged inside the implementation.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-27  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-26  6:05 [PATCH] xfs: add a check for xfs_trans_commit Kangjie Lu
2018-12-27  8:07 ` Christoph Hellwig

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).