lkml.org 
[lkml]   [2018]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] xfs: add a check for xfs_trans_commit
Date
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)
\
 
 \ /
  Last update: 2018-12-26 07:06    [W:0.060 / U:2.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site