]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ocfs2/aops.c
Merge branch 'akpm-current/current'
[karo-tx-linux.git] / fs / ocfs2 / aops.c
index 3d3952ebe1013d893f44b365c0d7439cdbe6a00f..56ce3704d66fbde73b27224eaa8716b0191acccf 100644 (file)
@@ -2399,14 +2399,17 @@ out:
  * particularly interested in the aio/dio case.  We use the rw_lock DLM lock
  * to protect io on one node from truncation on another.
  */
-static void ocfs2_dio_end_io(struct kiocb *iocb,
-                            loff_t offset,
-                            ssize_t bytes,
-                            void *private)
+static int ocfs2_dio_end_io(struct kiocb *iocb,
+                           loff_t offset,
+                           ssize_t bytes,
+                           void *private)
 {
        struct inode *inode = file_inode(iocb->ki_filp);
        int level;
 
+       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));
 
@@ -2417,6 +2420,8 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
 
        level = ocfs2_iocb_rw_locked_level(iocb);
        ocfs2_rw_unlock(inode, level);
+
+       return 0;
 }
 
 static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,