lkml.org 
[lkml]   [2019]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 176/306] hfsplus: update timestamps on truncate()
    Date
    From: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>

    [ Upstream commit dc8844aada735890a6de109bef327f5df36a982e ]

    The vfs takes care of updating ctime and mtime on ftruncate(), but on
    truncate() it must be done by the module.

    This patch can be tested with xfstests generic/313.

    Link: http://lkml.kernel.org/r/9beb0913eea37288599e8e1b7cec8768fb52d1b8.1539316825.git.ernesto.mnd.fernandez@gmail.com
    Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
    Reviewed-by: Vyacheslav Dubeyko <slava@dubeyko.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/hfsplus/inode.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
    index 8e9427a42b819..d7ab9d8c4b674 100644
    --- a/fs/hfsplus/inode.c
    +++ b/fs/hfsplus/inode.c
    @@ -261,6 +261,7 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
    }
    truncate_setsize(inode, attr->ia_size);
    hfsplus_file_truncate(inode);
    + inode->i_mtime = inode->i_ctime = current_time(inode);
    }

    setattr_copy(inode, attr);
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-11-27 22:03    [W:2.220 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site