afs: Fix afs_store_data() to set mtime in new operation descriptor
authorDavid Howells <dhowells@redhat.com>
Thu, 11 Jun 2020 20:50:24 +0000 (21:50 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jun 2020 23:04:30 +0000 (16:04 -0700)
Fix afs_store_data() so that it sets the mtime in the new operation
descriptor otherwise the mtime on the server gets set to 0 when a write is
stored to the server.

Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept")
Reported-by: Dave Botsch <botsch@cnf.cornell.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/write.c

index 97bccde..768497f 100644 (file)
@@ -447,6 +447,7 @@ static int afs_store_data(struct address_space *mapping,
        op->store.last = last;
        op->store.first_offset = offset;
        op->store.last_to = to;
+       op->mtime = vnode->vfs_inode.i_mtime;
        op->ops = &afs_store_data_operation;
 
 try_next_key: