From 2643f9c918b90b6642fe2b744d4872c5da426ccd Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 18 Apr 2014 10:41:09 -0400 Subject: [PATCH] add patch use-truncate_pagecache-in-collapse_range --- series | 1 + use-truncate_pagecache-in-collapse_range | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 use-truncate_pagecache-in-collapse_range diff --git a/series b/series index 8ce82014..9bf3de17 100644 --- a/series +++ b/series @@ -22,6 +22,7 @@ always-check-ext4_ext_find_extent-result add-fallocate-mode-blocking-for-debugging fix-ext4_count_free_clusters-with-bigalloc remove-COLLAPSE_RANGE-and-ZERO-RANGE-shim +use-truncate_pagecache-in-collapse_range # ^^^ above are to be pushed to Linus for 3.15-rc1 diff --git a/use-truncate_pagecache-in-collapse_range b/use-truncate_pagecache-in-collapse_range new file mode 100644 index 00000000..0174287d --- /dev/null +++ b/use-truncate_pagecache-in-collapse_range @@ -0,0 +1,37 @@ +ext4: use truncate_pagecache() in collapse range + +From: Lukas Czerner + +We should be using truncate_pagecache() instead of +truncate_pagecache_range() in the collapse range because we're +truncating page cache from offset to the end of file. +truncate_pagecache() also get rid of the private COWed pages from the +range because we're going to shift the end of the file. + +Signed-off-by: Lukas Czerner +Signed-off-by: "Theodore Ts'o" +--- + fs/ext4/extents.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c +index 5fa31cb..3a6e40c 100644 +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -5406,7 +5406,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) + goto out_mutex; + } + +- truncate_pagecache_range(inode, offset, -1); ++ truncate_pagecache(inode, offset); + + /* Wait for existing dio to complete */ + ext4_inode_block_unlocked_dio(inode); +-- +1.8.3.1 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-ext4" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + -- 2.11.4.GIT