diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/buffer.c patched/fs/buffer.c --- orig/fs/buffer.c 2003-03-10 18:21:44.000000000 -0600 +++ patched/fs/buffer.c 2003-03-10 18:21:38.000000000 -0600 @@ -2505,7 +2505,7 @@ */ block_invalidatepage(page, 0); unlock_page(page); - return -EIO; + return 0; /* don't care */ } /* diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/cifs/file.c patched/fs/cifs/file.c --- orig/fs/cifs/file.c 2003-03-10 18:21:43.000000000 -0600 +++ patched/fs/cifs/file.c 2003-03-10 18:25:27.000000000 -0600 @@ -428,12 +428,18 @@ write_data = kmap(page); write_data += from; - if((to > PAGE_CACHE_SIZE) || (from > to) || (offset > mapping->host->i_size)) { + if((to > PAGE_CACHE_SIZE) || (from > to)) { kunmap(page); FreeXid(xid); return -EIO; } + /* racing with truncate? */ + if(offset > mapping->host->i_size) { + FreeXid(xid); + return 0; /* don't care */ + } + /* check to make sure that we are not extending the file */ if(mapping->host->i_size - offset < (loff_t)to) to = (unsigned)(mapping->host->i_size - offset); diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/nfs/write.c patched/fs/nfs/write.c --- orig/fs/nfs/write.c 2003-03-10 18:21:43.000000000 -0600 +++ patched/fs/nfs/write.c 2003-03-10 18:21:38.000000000 -0600 @@ -231,7 +231,7 @@ struct inode *inode = page->mapping->host; unsigned long end_index; unsigned offset = PAGE_CACHE_SIZE; - int err = -EIO; + int err = 0; int flags_save; flags_save = current->flags; diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/ntfs/aops.c patched/fs/ntfs/aops.c --- orig/fs/ntfs/aops.c 2003-03-04 21:29:32.000000000 -0600 +++ patched/fs/ntfs/aops.c 2003-03-10 18:21:38.000000000 -0600 @@ -811,8 +811,8 @@ if (unlikely(page->index >= (vi->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT)) { unlock_page(page); - ntfs_debug("Write outside i_size. Returning i/o error."); - return -EIO; + ntfs_debug("Write outside i_size - truncated?"); + return 0; } ni = NTFS_I(vi); diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/reiserfs/inode.c patched/fs/reiserfs/inode.c --- orig/fs/reiserfs/inode.c 2003-03-10 18:21:43.000000000 -0600 +++ patched/fs/reiserfs/inode.c 2003-03-10 18:21:38.000000000 -0600 @@ -2036,8 +2036,8 @@ last_offset = inode->i_size & (PAGE_CACHE_SIZE - 1) ; /* no file contents in this page */ if (page->index >= end_index + 1 || !last_offset) { - error = -EIO ; - goto fail ; + error = 0 ; + goto done ; } kaddr = kmap_atomic(page, KM_USER0); memset(kaddr + last_offset, 0, PAGE_CACHE_SIZE-last_offset) ; diff -urN -x '*.ver' -x '.patch*' -x '*.orig' orig/fs/smbfs/file.c patched/fs/smbfs/file.c --- orig/fs/smbfs/file.c 2003-03-04 21:29:34.000000000 -0600 +++ patched/fs/smbfs/file.c 2003-03-10 18:21:38.000000000 -0600 @@ -193,7 +193,7 @@ offset = inode->i_size & (PAGE_CACHE_SIZE-1); /* OK, are we completely out? */ if (page->index >= end_index+1 || !offset) - return -EIO; + return 0; /* truncated - don't care */ do_it: page_cache_get(page); err = smb_writepage_sync(inode, page, 0, offset);