summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/aops.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2018-12-27 18:05:30 -0800
committerTejun Heo <tj@kernel.org>2018-12-27 18:05:30 -0800
commit4d71c6f8771a6bccb844244f09831fa4624b22c1 (patch)
tree9c6fdf753d64c839a4b0deb7d35d7e990c8e9971 /fs/ocfs2/aops.c
parent1e7eacaf1db2f0f5f62fceda4e6c5a8869f00c13 (diff)
parente9d81a1bc2c48ea9782e3e8b53875f419766ef47 (diff)
downloadlinux-4d71c6f8771a6bccb844244f09831fa4624b22c1.tar.bz2
Merge branch 'for-4.20-fixes' into for-4.21
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r--fs/ocfs2/aops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index da578ad4c08f..eb1ce30412dc 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2411,8 +2411,16 @@ static int ocfs2_dio_end_io(struct kiocb *iocb,
/* this io's submitter should not have unlocked this before we could */
BUG_ON(!ocfs2_iocb_is_rw_locked(iocb));
- if (bytes > 0 && private)
- ret = ocfs2_dio_end_io_write(inode, private, offset, bytes);
+ if (bytes <= 0)
+ mlog_ratelimited(ML_ERROR, "Direct IO failed, bytes = %lld",
+ (long long)bytes);
+ if (private) {
+ if (bytes > 0)
+ ret = ocfs2_dio_end_io_write(inode, private, offset,
+ bytes);
+ else
+ ocfs2_dio_free_write_ctx(inode, private);
+ }
ocfs2_iocb_clear_rw_locked(iocb);