Skip to contentSkip to conversation

ext4: Use truncate_pagecache() in collapse range

PATCH Applied Lukas Czerner 2 participants 2 messages Apr 18, 2014 1 message not in the archive ext4 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 002101cf5ac76d97bf048c73d0samsung.com

#1 lore raw

PATCH 1/1 ext4: Use truncate_pagecache() in collapse range

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.

---
 fs/ext4/extents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents.c +1 -1
index 5fa31cb..3a6e40c 100644
@@ -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);
Signature · 1 line
1.8.3.1
maintainer Applied
#2 lore raw
Quoted 7 lines · 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.

Thanks, applied.

- Ted