From 0df76f5ecc4bb65fcc5a63399900acec672b9fbd Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Mon, 7 Mar 2011 11:10:24 -0500 Subject: [PATCH] --- yaml --- r: 234090 b: refs/heads/master c: 31339acd07b4ba687906702085127895a56eb920 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/file.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3a05bfc17da5..c3d09b791aad 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1bf862e9dad431175a1174379476299dbfdc017 +refs/heads/master: 31339acd07b4ba687906702085127895a56eb920 diff --git a/trunk/fs/btrfs/file.c b/trunk/fs/btrfs/file.c index 13664b315fe2..ab22ca4f237f 100644 --- a/trunk/fs/btrfs/file.c +++ b/trunk/fs/btrfs/file.c @@ -69,6 +69,19 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages, /* Flush processor's dcache for this page */ flush_dcache_page(page); + + /* + * if we get a partial write, we can end up with + * partially up to date pages. These add + * a lot of complexity, so make sure they don't + * happen by forcing this copy to be retried. + * + * The rest of the btrfs_file_write code will fall + * back to page at a time copies after we return 0. + */ + if (!PageUptodate(page) && copied < count) + copied = 0; + iov_iter_advance(i, copied); write_bytes -= copied; total_copied += copied;