From patchwork Tue Jun 23 19:56:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AEA4C433E0 for ; Tue, 23 Jun 2020 21:27:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F2332078A for ; Tue, 23 Jun 2020 21:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592947626; bh=b4gTfTW1pZ1m56c1doEGfZiFBU0YZ15qyZ7TENd/P4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=p5mfVRwYaeN/eY2jV/YFCHrvOxgRmeSs3t6n3YXvzzFRVgB9NWKqAx2zJZhlr2ezz +FfdlKrNYf+ZbCe2JcTRfSWCf/Prgf/7+XxQ2vHOQmGFQYmKmf7ughkK/81y8iTxIg me65Jtsdrh4CGVPuQ5P6EaLCV/TCs1EiS0xTgVJc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389536AbgFWURU (ORCPT ); Tue, 23 Jun 2020 16:17:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389530AbgFWURT (ORCPT ); Tue, 23 Jun 2020 16:17:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D0C22137B; Tue, 23 Jun 2020 20:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943439; bh=b4gTfTW1pZ1m56c1doEGfZiFBU0YZ15qyZ7TENd/P4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F+/MS1oO8q+QNO7Q84R8NUuw3zpSn8b38KWL3dck9PYZfqhl300x2ZPVvriDia6iC u1bA1kijaajVKH8a6aZ1s2b85cAvzu7JlrjfJRk760eS3fdB8nT4bLnUTbFgRDZfPn hqtHsJIyC1tfj08F9vvuiI9Bva+Hpg9TwT16iZOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Sasha Levin Subject: [PATCH 5.7 392/477] afs: Fix non-setting of mtime when writing into mmap Date: Tue, 23 Jun 2020 21:56:29 +0200 Message-Id: <20200623195426.056563871@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Howells [ Upstream commit bb413489288e4e457353bac513fddb6330d245ca ] The mtime on an inode needs to be updated when a write is made into an mmap'ed section. There are three ways in which this could be done: update it when page_mkwrite is called, update it when a page is changed from dirty to writeback or leave it to the server and fix the mtime up from the reply to the StoreData RPC. Found with the generic/215 xfstest. Fixes: 1cf7a1518aef ("afs: Implement shared-writeable mmap") Signed-off-by: David Howells Signed-off-by: Sasha Levin --- fs/afs/write.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/afs/write.c b/fs/afs/write.c index cb76566763dba..371db86c6c5ec 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -811,6 +811,7 @@ vm_fault_t afs_page_mkwrite(struct vm_fault *vmf) vmf->page->index, priv); SetPagePrivate(vmf->page); set_page_private(vmf->page, priv); + file_update_time(file); sb_end_pagefault(inode->i_sb); return VM_FAULT_LOCKED;