Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9397250rwd; Wed, 21 Jun 2023 07:02:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VRiGXypCS3/wcUk1fTt0wYMo/o4qYFVkKC5D7KyhvqNlpCUifQXNDLzXvlysuBgro0QVv X-Received: by 2002:a05:6a20:4418:b0:11f:4f17:1b21 with SMTP id ce24-20020a056a20441800b0011f4f171b21mr13674764pzb.21.1687356152469; Wed, 21 Jun 2023 07:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687356152; cv=none; d=google.com; s=arc-20160816; b=UXD+sgqmHFDncVinXwMrYZCXXsJ1zTF3SpiFi6HCoLFb01Fz7nm3cpOc5xez96a5bJ rvSsntnNhuXGYdf4kpQFTUA8WLmEzUdjpElN4c81VjU1a3+W2ZOtp7mU8ie+5kNjKZDd T3vH49GP2MrbQBDLnT9bBo8q0aiZdmY0LHhNP9ftCz1ukmgLc+JD7nmSgcOPiAgbLh32 nIbM32tdZq0IZW9CoJY3/BOpMBvWC+Em4nGLEBAY+xiGuVteYrWFI5fDEw+pMBazHrad 2yCKnzI2Pxd8KV0wRzuCJxRbvik67mp4+cMYE3xtEL39xzc73tpC7Y1kDluWxzoBozS1 QbtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jd1MeGn2IWF85uEFPAcc6lXeFNLFuhytuj2ifchJWNo=; b=iPayLgySRHJBlnWl1Zm8cqoDH+2V7fTs9hEz/3LlyLRuhYi7h53g13QK+dgw0DPwZW bKjNn5uLtRhkLOHyrylnnPjG4y/Dqj0mGJddGBUPnyOHJugm0oZBMpEOIpzsj55yyTI+ 1eqpEURFytoxi/ZSKlgVL21iOiAblbfp/3EkWrhJgEcDa2jqLhrWaUplrE1BDwuteQ2V judlh1WMnznKMLdqV9WaNAPQbP2npOsMGUniUuHBQzN4pO3HwaMHKbaM+MOkXSTGh2nf M3Mn3i2HYf6IYLbgV1Fg3CZioyknu/t/tvkCJjDZZnms63lJYqxIkQhvVcfQDFuM8Yw7 Udaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=elAsHbJh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z128-20020a633386000000b0054ff8cce912si4187394pgz.281.2023.06.21.07.02.14; Wed, 21 Jun 2023 07:02:32 -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=@kernel.org header.s=k20201202 header.b=elAsHbJh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232641AbjFUNj3 (ORCPT + 99 others); Wed, 21 Jun 2023 09:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232654AbjFUNj1 (ORCPT ); Wed, 21 Jun 2023 09:39:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C298419AC for ; Wed, 21 Jun 2023 06:39:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5127B614E9 for ; Wed, 21 Jun 2023 13:39:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACF29C433C0; Wed, 21 Jun 2023 13:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687354764; bh=cPsPjRKWcEmtzMQaG/waG+l05hgrMv31+72e1daYl9M=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=elAsHbJhVVL5byp6B61wcncTPmAifiqJYTATP71ljhJRJ772RaHrY/aysK1dWm1eQ wbWXf+Eg2zV58tzr5jHEQ/fNPLZFpmzc0Jn1JBj+HsB5bKArHRvvNhunaVGk50PE+1 LSftbspqLEjjDpd2Suh3Lk3NFPWCOsZ/AMpkX/XaMH4MSdKNP4gKjPD78YNra37bPs VEWIxAWCXkHd62mLIDsfHqMCoIpHTK71SYQqdi09kfmD4RLLqLsbNFrl6tq6YV9f0u 0swlglT7SRAtanxh51wMrFomm0mg1BdKefK+lJgKkWzmpUkkMkHoeu/UySWfouu2WE mN42R3oh6jZvg== Message-ID: <9f3a5518-1de5-17b9-5aec-9820fe79c223@kernel.org> Date: Wed, 21 Jun 2023 21:39:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [f2fs-dev][PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method To: Yunlei He , jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20230621094359.3827832-1-heyunlei@oppo.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20230621094359.3827832-1-heyunlei@oppo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 2023/6/21 17:43, Yunlei He wrote: > Mtime and ctime stay old value without update after move > file range ioctl. This patch add time update. > > Signed-off-by: Yunlei He > --- > v2: > -update both src and dst inode > fs/f2fs/file.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > index cb42d8464ad9..4adcf62e2665 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -2884,8 +2884,22 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, > > if (src != dst) > f2fs_up_write(&F2FS_I(dst)->i_gc_rwsem[WRITE]); > + Unneeded blank line. > out_src: > f2fs_up_write(&F2FS_I(src)->i_gc_rwsem[WRITE]); > + > + if (!ret) { > + src->i_mtime = src->i_ctime = current_time(src); > + f2fs_mark_inode_dirty_sync(src, false); > + > + if (src != dst) { > + dst->i_mtime = dst->i_ctime = current_time(dst); > + f2fs_mark_inode_dirty_sync(dst, false); > + } > + > + f2fs_update_time(F2FS_I_SB(src), REQ_TIME); f2fs_update_time(sbi, REQ_TIME); Thanks, > + } > + > out_unlock: > if (src != dst) > inode_unlock(dst);