]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
GFS2: fallocate: do not rely on file_update_time to mark the inode dirty
authorAndrew Price <anprice@redhat.com>
Tue, 22 Sep 2015 12:41:21 +0000 (07:41 -0500)
committerBob Peterson <rpeterso@redhat.com>
Tue, 22 Sep 2015 12:41:46 +0000 (07:41 -0500)
Previously __gfs2_fallocate() relied on file_update_time() marking the
inode dirty, but that's not a safe assumption as that function doesn't
dirty the inode in some cases. Mark the inode dirty explicitly.

Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/file.c

index cf4ab89159f48641017b0feb57971d6e5c6a38bd..71cd138c0676e9602fd146cbe5c36922a32be913 100644 (file)
@@ -897,8 +897,8 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
 
        if (!(mode & FALLOC_FL_KEEP_SIZE) && (pos + count) > inode->i_size) {
                i_size_write(inode, pos + count);
-               /* Marks the inode as dirty */
                file_update_time(file);
+               mark_inode_dirty(inode);
        }
 
        return generic_write_sync(file, pos, count);