Index: linux-2.6/mm/filemap.c =================================================================== --- linux-2.6.orig/mm/filemap.c +++ linux-2.6/mm/filemap.c @@ -2184,6 +2184,7 @@ fs_write_aop_error: return written ? written : status; } +#include static ssize_t generic_perform_write(struct file *file, struct iov_iter *i, loff_t pos) { @@ -2243,6 +2244,13 @@ again: page, fsdata); if (unlikely(status < 0)) break; + if (status > copied) { + print_symbol("%s returned more than it should!\n", (unsigned long)a_ops->write_end); + printk("status = %ld, copied = %lu\n", status, copied); + dump_stack(); + status = copied; /* try to fix */ + } + copied = status; cond_resched();