linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Use truncate_pagecache() in collapse range
       [not found] <002101cf5ac76d97bf048c73d0samsung.com>
@ 2014-04-18 11:22 ` Lukas Czerner
  2014-04-18 14:21   ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Czerner @ 2014-04-18 11:22 UTC (permalink / raw)
  To: linux-ext4; +Cc: namjae.jeon, 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 <lczerner@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: Use truncate_pagecache() in collapse range
  2014-04-18 11:22 ` [PATCH] ext4: Use truncate_pagecache() in collapse range Lukas Czerner
@ 2014-04-18 14:21   ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2014-04-18 14:21 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4, namjae.jeon

On Fri, Apr 18, 2014 at 01:22:04PM +0200, Lukas Czerner wrote:
> 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 <lczerner@redhat.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-18 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <002101cf5ac76d97bf048c73d0samsung.com>
2014-04-18 11:22 ` [PATCH] ext4: Use truncate_pagecache() in collapse range Lukas Czerner
2014-04-18 14:21   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).