lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch] tmpfs: add fallocate support
From
Date
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/

\
 
 \ /
  Last update: 2011-11-17 00:25    [from the cache]
©2003-2011 Jasper Spaans