Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp177898rwb; Wed, 10 Aug 2022 22:28:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR7j/3uOeBeK5ZizGpEvIge3u1NNiXTqjFvyRizBHrhiKTsR8BLKz4j7IyBeGzGGlQQApz2X X-Received: by 2002:a17:907:2808:b0:731:6553:fc10 with SMTP id eb8-20020a170907280800b007316553fc10mr11876567ejc.753.1660195704778; Wed, 10 Aug 2022 22:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660195704; cv=none; d=google.com; s=arc-20160816; b=cZzfzBIPOtN9gRGOMhcDmLr5fhR/5U22Lv4eAoZQ3H5Wsa7Ebq/m99Nij6dUxHmUqd Els5mHuZQYz4LQ6keMIDo8w96KtrPegtjcw1uk1ohKxy5Rt9ohf6Do20CGvj0WddpQNb /d/6NxtKMbEYAM/oYu8fAIj8w8EoyC0qTJl74oP5z4XVBw65lkJYF6nclKaNvgEs4yk+ 37MD9yX+wD91F9n20tgsWV2IzaX72qDNyOiWSaW0g6XLirtE+BoK+jPB27SZMjTxN6fp /hSmKpCyvq5MkMJAE3sm8B679AJ/5Gya/mm4r4z+6Tr20tlW3NQH+2OwEpIUcuhM1O+Y DDjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=Livy2eVp0oE6BvapXUHOqoc+qrYCMvetxKGx/oHIznU=; b=VGmkvxj9VxGhzGEe7G4Bsgft92m8PSIik1iB3+vfFvy5Y5L8zuIFMc91ta7zNXHYkn mEEQ2sxHQAFFFefcU7Z0qUAHScS7Uz0LkVFMxYix3XpbDy7uOEVd8qrfEJHeJq/eXtYt XBbqrI5RQLb7fleT5UrvVZTY4yO1pJHVjdVYetIVMEt4VqlmR8yZr3A9yEKa4KzAAfo5 nJ3bRgBbadgFTTWgC22xA2qksCo4kYyWJFhfx29tfjRXNULlelxI3KGrwjHHGGbnlBvx 1XxL6iJpZHljMA+BLDEzBbxa1GGEarR5T+y7B8dv4d2IGiwMKjAMQ30JJUiKgqhcFDs+ ZCYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KYTrUnak; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a17090658ca00b00730d0b86b28si7425761ejs.761.2022.08.10.22.27.53; Wed, 10 Aug 2022 22:28:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KYTrUnak; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229617AbiHKEzn (ORCPT + 99 others); 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-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 X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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; }