xfs: add a check for xfs_trans_commit
PATCH 1/1 xfs: add a check for xfs_trans_commit
xfs_trans_commit could fails. The checks issues an error message upon its failure.
Signed-off-by Kangjie Lu <[email protected]>
--- fs/xfs/xfs_super.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/xfs/xfs_super.c +5 -1
@@ -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); }/*
Signature · 1 line
2.17.2 (Apple Git-113)
Quoted 4 lines · Kangjie Lu
xfs_trans_commitcould fails. The checks issues an error message upon its failure.Signed-off-by Kangjie Lu <[email protected]>
Please take a close look at what could fail in xfs_trans_commit, and how those failures are logged inside the implementation.