]> Git Repo - linux.git/commitdiff
ocfs2: truncate outstanding block after direct io failure
authorDmitri Monakhov <[email protected]>
Mon, 27 Oct 2008 20:01:49 +0000 (13:01 -0700)
committerMark Fasheh <[email protected]>
Mon, 10 Nov 2008 17:51:47 +0000 (09:51 -0800)
Signed-off-by: Dmitri Monakhov <[email protected]>
Cc: Jeff Moyer <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Nick Piggin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Mark Fasheh <[email protected]>
fs/ocfs2/file.c

index 3138a385fdbb3383a3391b1a7dca62242aa567e1..e2570a3bc2b202e2abb833be86ffc7750cc635c7 100644 (file)
@@ -1866,6 +1866,13 @@ relock:
                written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos,
                                                    ppos, count, ocount);
                if (written < 0) {
+                       /*
+                        * direct write may have instantiated a few
+                        * blocks outside i_size. Trim these off again.
+                        * Don't need i_size_read because we hold i_mutex.
+                        */
+                       if (*ppos + count > inode->i_size)
+                               vmtruncate(inode, inode->i_size);
                        ret = written;
                        goto out_dio;
                }
This page took 0.05732 seconds and 4 git commands to generate.