On Wed, 2011-11-16 at 15:21 +0800, Cong Wang wrote: > 于 2011年11月16日 01:43, Dave Hansen 写道: > > On Tue, 2011-11-15 at 18:23 +0800, Cong Wang wrote: > >>> + if (!(mode& FALLOC_FL_KEEP_SIZE)) { > >>> + ret = inode_newsize_ok(inode, (offset + len)); > >>> + if (ret) > >>> + return ret; > >>> + } > > > > inode_newsize_ok()'s comments say: > > > > * inode_newsize_ok must be called with i_mutex held. > > > > But I don't see any trace of it. > > Hmm, even for tmpfs? I see none of the tmpfs code takes > i_mutex lock though... Look harder. :) ramfs/tmpfs for a large part just used the generic VFS functions to do their work since they're page-cache based. For instance: static const struct file_operations shmem_file_operations = { ... .aio_write = generic_file_aio_write, IOW, you need to check beyond mm/shmem.c. -- Dave -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. 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@xxxxxxxxx"> email@xxxxxxxxx </a>