lkml.org 
[lkml]   [2009]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [rfc][patch 1/3] fs: new truncate sequence
    From
    Date
    > Index: linux-2.6/mm/truncate.c
    > ===================================================================
    > --- linux-2.6.orig/mm/truncate.c
    > +++ linux-2.6/mm/truncate.c
    > @@ -465,3 +465,79 @@ int invalidate_inode_pages2(struct addre
    > return invalidate_inode_pages2_range(mapping, 0, -1);
    > }
    > EXPORT_SYMBOL_GPL(invalidate_inode_pages2);
    > +
    > +/**
    > + * truncate_pagecache - unmap mappings "freed" by truncate() syscall
    > + * @inode: inode
    > + * @old: old file offset
    > + * @new: new file offset
    > + *
    > + * inode's new i_size must already be written before truncate_pagecache
    > + * is called.
    > + */
    > +void truncate_pagecache(struct inode * inode, loff_t old, loff_t new)
    > +{
    > + VM_BUG_ON(inode->i_size != new);

    This is not true for fuse (and NFS?) as i_size isn't protected by
    i_mutex during attribute revalidation, and so it can change during the
    truncate.

    Thanks,
    Miklos


    \
     
     \ /
      Last update: 2009-07-06 20:03    [W:4.606 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site