Commit dbf896fc authored by Darrick J. Wong's avatar Darrick J. Wong

ocfs2: always unlock when completing dio writes

Always unlock the inode when completing dio writes, even if an error
has occurrred.  The caller already checks the inode and unlocks it
if needed, so we might as well reduce contention.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 08554955
......@@ -2392,13 +2392,10 @@ static int ocfs2_dio_end_io(struct kiocb *iocb,
int level;
int ret = 0;
if (bytes <= 0)
return 0;
/* this io's submitter should not have unlocked this before we could */
BUG_ON(!ocfs2_iocb_is_rw_locked(iocb));
if (private)
if (bytes > 0 && private)
ret = ocfs2_dio_end_io_write(inode, private, offset, bytes);
ocfs2_iocb_clear_rw_locked(iocb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment