diff options
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 12 |
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, | |||
2411 | /* this io's submitter should not have unlocked this before we could */ | 2411 | /* this io's submitter should not have unlocked this before we could */ |
2412 | BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); | 2412 | BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); |
2413 | 2413 | ||
2414 | if (bytes > 0 && private) | 2414 | if (bytes <= 0) |
2415 | ret = ocfs2_dio_end_io_write(inode, private, offset, bytes); | 2415 | mlog_ratelimited(ML_ERROR, "Direct IO failed, bytes = %lld", |
2416 | (long long)bytes); | ||
2417 | if (private) { | ||
2418 | if (bytes > 0) | ||
2419 | ret = ocfs2_dio_end_io_write(inode, private, offset, | ||
2420 | bytes); | ||
2421 | else | ||
2422 | ocfs2_dio_free_write_ctx(inode, private); | ||
2423 | } | ||
2416 | 2424 | ||
2417 | ocfs2_iocb_clear_rw_locked(iocb); | 2425 | ocfs2_iocb_clear_rw_locked(iocb); |
2418 | 2426 | ||