From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3066BC19F2D for ; Thu, 11 Aug 2022 04:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233930AbiHKEzn (ORCPT ); Thu, 11 Aug 2022 00:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233898AbiHKEzk (ORCPT ); Thu, 11 Aug 2022 00:55:40 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF5D606BA for ; Wed, 10 Aug 2022 21:55:39 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id e28so4713278qts.1 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=SwcVQ0wmLwHV8Gih86oXrdiO7TyTRLYE1JJek5MTzvUvGJQUzKGxrYWkbtTLJZj+lj hGj8j84mYNc4a0D3VYSRUVSrUS20K2l31TmENlc/NyxLetuz1aKSht3qmyMUOc/EZ+v7 sGFz+VFTvmM2HCFPEF/Y7L15NfeEbVy0GfwULAm2DIgSq2ZkotWlgjzci+ripVyxJJ2V 51omQ/kopK2ggyc+igp8LmQWmwIRFUs+cFhHbsiSM2lMdCiV+f2M1rHOJE5a8CdNvGji cuKR83EA9CHL6eKjPBNLs4ZJd0REC5CyI4pA1Jklmb0+fxlHiirlsYYhqBjqRz5zJPnL zKgw== X-Gm-Message-State: ACgBeo2DhpRYuRT0Tni7C0DKj0d8T3Hs9wA8ejjJSo/mKRsUuJEeqZl+ +2JnRWfqwhzDahJSCyEh2gQobw== 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 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; }