

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/direct-io.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff -puN fs/direct-io.c~direct-io-hole-fix fs/direct-io.c
--- 25/fs/direct-io.c~direct-io-hole-fix	Fri May 28 15:28:06 2004
+++ 25-akpm/fs/direct-io.c	Fri May 28 15:28:22 2004
@@ -987,13 +987,6 @@ direct_io_worker(int rw, struct kiocb *i
 		}
 	} /* end iovec loop */
 
-	if (ret == -ENOTBLK && rw == WRITE) {
-		/*
-		 * The remaining part of the request will be
-		 * be handled by buffered I/O when we return
-		 */
-		ret = 0;
-	}
 	/*
 	 * There may be some unwritten disk at the end of a part-written
 	 * fs-block-sized block.  Go zero that now.
@@ -1088,6 +1081,13 @@ direct_io_worker(int rw, struct kiocb *i
 			aio_complete(iocb, ret, 0);
 		kfree(dio);
 	}
+	if (ret == -ENOTBLK && rw == WRITE) {
+		/*
+		 * The entire request will be be handled by buffered I/O
+		 * when we return
+		 */
+		ret = 0;
+	}
 	return ret;
 }
 
_
