summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorDarrick J. Wong2016-12-02 01:31:14 +0100
committerDarrick J. Wong2016-12-10 21:39:45 +0100
commitdbf896fc286a62bf215b904c6ff5d197df93e685 (patch)
tree35b17d49eace7cd159300102f5d55d687759ddaa /fs/ocfs2
parentocfs2: don't eat io errors during _dio_end_io_write (diff)
downloadkernel-qcow2-linux-dbf896fc286a62bf215b904c6ff5d197df93e685.tar.gz
kernel-qcow2-linux-dbf896fc286a62bf215b904c6ff5d197df93e685.tar.xz
kernel-qcow2-linux-dbf896fc286a62bf215b904c6ff5d197df93e685.zip
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: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/aops.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 136a49cabc12..3c531f108a21 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -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);