Thread (10 messages) 10 messages, 3 authors, 2012-05-17

Re: [PATCH] mm for fs: add truncate_pagecache_range

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2012-03-23 22:59:50
Also in: linux-fsdevel, lkml

On Fri, 23 Mar 2012 14:14:54 -0700 (PDT)
Hugh Dickins [off-list ref] wrote:
On Fri, 23 Mar 2012, Andrew Morton wrote:
quoted
--- a/mm/truncate.c~mm-for-fs-add-truncate_pagecache_range-fix
+++ a/mm/truncate.c
@@ -639,6 +639,9 @@ int vmtruncate_range(struct inode *inode
  * with on-disk format, and the filesystem would not have to deal with
  * situations such as writepage being called for a page that has already
  * had its underlying blocks deallocated.
+ *
+ * Must be called with inode->i_mapping->i_mutex held.
You catch me offguard: I forget whether that's an absolute requirement or
just commonly the case.  What do the other interfaces in truncate.c say ?-)
i_mutex is generally required, to stabilise i_size.
quoted
+ * Takes inode->i_mapping->i_mmap_mutex.
Yes, and inode->i_mapping->tree_lock.
I don't think it's necessary to get into the spinning locks for a
high-level function which clearly does sleeping things.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help