From patchwork Thu Aug 11 04:55:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12941148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0343DC19F2D for ; Thu, 11 Aug 2022 04:55:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91A786B0073; Thu, 11 Aug 2022 00:55:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CA736B0074; Thu, 11 Aug 2022 00:55:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 791A58E0001; Thu, 11 Aug 2022 00:55:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 673AC6B0073 for ; Thu, 11 Aug 2022 00:55:40 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C7CED805F4 for ; Thu, 11 Aug 2022 04:55:39 +0000 (UTC) X-FDA: 79786098798.25.C537D1D Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf05.hostedemail.com (Postfix) with ESMTP id 7ABE3100180 for ; Thu, 11 Aug 2022 04:55:39 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id s11so5802624qtx.6 for ; Wed, 10 Aug 2022 21:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:message-id:subject:cc:to:from:date:from:to:cc; bh=Livy2eVp0oE6BvapXUHOqoc+qrYCMvetxKGx/oHIznU=; b=KYTrUnak0g/usjIFO/ZNDzJxAOGsMVs1p9UqyFngCX4RIQ2DhFYpf7yXJbAuSyNX8V tXLInbqEaia/rWRDMzQ2cmqhqvi7w8r40U2u8xmdsl5ZgwDQOrNAjiFQkRgW46gvP9cQ ye2YKsn3lpYXP5HbehH5s92HgTRT8biHp3dcxAc7Yna3k2Lm2iJISektyNABe1nRXzYs JQto9/AHKRUxSR9VBP9mf2AfeXUd2RBew76Jic7w4t72yC6t/hEJhdUsUet2PaaXG+it /bJnc3Z6gGNSy2O0o3rA7Da+zr+yfNsIDQicrNEGlVJEQhh9x4P1k+GbaelgZ0GAJnCR kb7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc; bh=Livy2eVp0oE6BvapXUHOqoc+qrYCMvetxKGx/oHIznU=; b=nyu+2H6OUkqwHHHtvGarzYTh/hhBmhilkuiZXPx7NkK/Rt2oVdeAX9Mq864HGWwoHy F093c9PXEASyUQpf/96R2iTw7YQAa7dG5RVHmYhzT/wDB4uY/duke/S+Cx0C0NXB+fTc GJPZoWbPqxObkfyf+YHUmQmjMY5tgaS6oMwNVnssXVddtKESRwIEJ8cEVVXGHG77/Lgu Zk4XFotXxfiW3zQTMfGy5rd3KJ5567kBJ1RIXA3CgJgLmYwDuBajJ5k/c0i+wenlvq9y 6Rzb8ZRffg7Q4iRq1FxCk1laeC7vm/4dz8rWDylu94ZU76uUpyxlttyV+NO1Gd1IO8wn rZDg== X-Gm-Message-State: ACgBeo0U12Tn1uaVc8J4enbl8OuJEUgwfpe95x+W/jwMC5uQ0jE/L+e4 7OaqmE6014F4JcrmThAznQOjwQ== X-Google-Smtp-Source: AA6agR4AybdacHnM4HqeZIxBY+/3+U4qzpHnjFLWyZ+Sv/uep2K5Ga46VfT3pVrkxOdkftnl12lyFA== X-Received: by 2002:ac8:7d92:0:b0:31f:1fe3:2bfe with SMTP id c18-20020ac87d92000000b0031f1fe32bfemr27577728qtd.628.1660193738692; Wed, 10 Aug 2022 21:55:38 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id y6-20020ae9f406000000b006b8cff25187sm1261607qkl.42.2022.08.10.21.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 21:55:38 -0700 (PDT) Date: Wed, 10 Aug 2022 21:55:36 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: "Darrick J. Wong" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] mm/shmem: tmpfs fallocate use file_modified() Message-ID: <39c5e62-4896-7795-c0a0-f79c50d4909@google.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660193739; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Livy2eVp0oE6BvapXUHOqoc+qrYCMvetxKGx/oHIznU=; b=nJ2pEHUH5thtdZ3gVjOSzViOH/0dIBF2fVNet1a5f5TZ9hrd1fmn4TS5NPu7sVEf5h4HyC /ZDHxGKDWHkZat+/FE6hv5s5k5z5MXHU6Rgyq3PweNmy2+rTiVRnURPvDHX3Aq9DegCcDR fcjutcOVXDH6P2d7fhaOgDa8POt1JLo= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KYTrUnak; spf=pass (imf05.hostedemail.com: domain of hughd@google.com designates 209.85.160.170 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660193739; a=rsa-sha256; cv=none; b=2tdWmBwH2y7uPmjNJHoVvVS9FbcTM0EyAOkoo06Nn1E5f/7Lcji/8Wuipc5hbV1X9ZRWTh fqbIARiHqJGItLe2xjjDKnQaX9dMXtyEsHeKqvutxaRT34Uw7sotxB29jpCEx5Wva8xOrS kH8jkNZ00S0b4R7SJX3WYV0SUrdSE5A= X-Stat-Signature: r8pzxci5bd678oh9j8sbdx33ypmb5atc X-Rspamd-Queue-Id: 7ABE3100180 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KYTrUnak; spf=pass (imf05.hostedemail.com: domain of hughd@google.com designates 209.85.160.170 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1660193739-804623 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 5.18 fixed the btrfs and ext4 fallocates to use file_modified(), as xfs was already doing, to drop privileges: and fstests generic/{683,684,688} expect this. There's no need to argue over keep-size allocation (which could just update ctime): fix shmem_fallocate() to behave the same way. Signed-off-by: Hugh Dickins Acked-by: Christian Brauner (Microsoft) --- mm/shmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2839,12 +2839,13 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) i_size_write(inode, offset + len); - inode->i_ctime = current_time(inode); undone: spin_lock(&inode->i_lock); inode->i_private = NULL; spin_unlock(&inode->i_lock); out: + if (!error) + file_modified(file); inode_unlock(inode); return error; }