Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  • Dave Chinner's avatar
    xfs: fallocate() should call file_modified() · fbe7e520
    Dave Chinner authored
    
    In XFS, we always update the inode change and modification time when
    any fallocate() operation succeeds.  Furthermore, as various
    fallocate modes can change the file contents (extending EOF,
    punching holes, zeroing things, shifting extents), we should drop
    file privileges like suid just like we do for a regular write().
    There's already a VFS helper that figures all this out for us, so
    use that.
    
    The net effect of this is that we no longer drop suid/sgid if the
    caller is root, but we also now drop file capabilities.
    
    We also move the xfs_update_prealloc_flags() function so that it now
    is only called by the scope that needs to set the the prealloc flag.
    
    Based on a patch from Darrick Wong.
    
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    fbe7e520