projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80bcaf3
)
ocfs2: truncate outstanding block after direct io failure
author
Dmitri Monakhov
<
[email protected]
>
Mon, 27 Oct 2008 20:01:49 +0000
(13:01 -0700)
committer
Mark 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
patch
|
blob
|
history
diff --git
a/fs/ocfs2/file.c
b/fs/ocfs2/file.c
index 3138a385fdbb3383a3391b1a7dca62242aa567e1..e2570a3bc2b202e2abb833be86ffc7750cc635c7 100644
(file)
--- a/
fs/ocfs2/file.c
+++ b/
fs/ocfs2/file.c
@@
-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;
}