afs: Fix setting of mtime when creating a file/dir/symlink
stable inclusion from stable-v5.10.184 commit 2d3e4c5b3e0583742ad2bd7d61232577c01cf52f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2d3e4c5b3e0583742ad2bd7d61232577c01cf52f -------------------------------- [ Upstream commit a27648c7 ] kafs incorrectly passes a zero mtime (ie. 1st Jan 1970) to the server when creating a file, dir or symlink because the mtime recorded in the afs_operation struct gets passed to the server by the marshalling routines, but the afs_mkdir(), afs_create() and afs_symlink() functions don't set it. This gets masked if a file or directory is subsequently modified. Fix this by filling in op->mtime before calling the create op. Fixes: e49c7b2f ("afs: Build an abstraction around an "operation" concept") Signed-off-by:David Howells <dhowells@redhat.com> Reviewed-by:
Jeffrey Altman <jaltman@auristor.com> Reviewed-by:
Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment