[PATCH] xfs: add a check for xfs_trans_commit
From: Kangjie Lu
Date: Wed Dec 26 2018 - 01:05:56 EST
xfs_trans_commit could fails. The checks issues an error message upon
its failure.
Signed-off-by: Kangjie Lu <kjlu@xxxxxxx>
---
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)