Messages in this thread | ![/](/images/icornerl.gif) | | Subject | Re: [Patch] tmpfs: add fallocate support | From | Dave Hansen <> | Date | Wed, 16 Nov 2011 15:21:55 -0800 |
| |
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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |