diff options
-rw-r--r-- | fs/btrfs/file.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 13664b315fe2..ab22ca4f237f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -69,6 +69,19 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages, | |||
69 | 69 | ||
70 | /* Flush processor's dcache for this page */ | 70 | /* Flush processor's dcache for this page */ |
71 | flush_dcache_page(page); | 71 | flush_dcache_page(page); |
72 | |||
73 | /* | ||
74 | * if we get a partial write, we can end up with | ||
75 | * partially up to date pages. These add | ||
76 | * a lot of complexity, so make sure they don't | ||
77 | * happen by forcing this copy to be retried. | ||
78 | * | ||
79 | * The rest of the btrfs_file_write code will fall | ||
80 | * back to page at a time copies after we return 0. | ||
81 | */ | ||
82 | if (!PageUptodate(page) && copied < count) | ||
83 | copied = 0; | ||
84 | |||
72 | iov_iter_advance(i, copied); | 85 | iov_iter_advance(i, copied); |
73 | write_bytes -= copied; | 86 | write_bytes -= copied; |
74 | total_copied += copied; | 87 | total_copied += copied; |