Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1659317rwd; Wed, 31 May 2023 17:45:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68LVBoa9Pu5ICw81SGzqj4kqQU4KG1uc0sK7aGGzfqDkE6vnZ62FHMVD3yW3XCVOkzlZih X-Received: by 2002:a17:90a:dc06:b0:255:3ab1:df80 with SMTP id i6-20020a17090adc0600b002553ab1df80mr7406074pjv.21.1685580322321; Wed, 31 May 2023 17:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685580322; cv=none; d=google.com; s=arc-20160816; b=jwH8T6eejI/W3q4u9YpOws0GkrC7WsbSpUVdaTJ/wUULHIt11DUNe25kdp2SWlyfIx udf1st/zG9ogNgExnJoxZJOxCpuEYpHCkJaMQfjK9pGCLpUYAkXpK1cmrwLqvUu9RU6D frdB+ziMoEc5GzgBKXouR+g0sOD6XTLwdDf3HNExAe0E2p6yFOnslaRheXH+CVBlxwq0 HBXERNAeHZdkSVJyPIKCRf3aFr+B+NTwUKDFXEDBcerowWRqhzDxb/DA6tkJJdysvGJl jrEyCQesJ87T4SfzQjFxHGJisR4lBa8EcZq7bbKr/lW1ieDmn2vWK3IMjmpdFbHM2JTp ZODQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:organization:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=Ba6NfbAlZjooTNzC08xLujS6IOv8AY7/By4Y/0T23EY=; b=01atfAQk4HppXtg2ZvSFVdDxEdrgzR8j/D37No9Jda7s8+yeEy6hdE/t8Df0NI6KcA PJfLZzkq0cNJzip7Bivd9KMH1ByZB+k7e5t/XVR/X+PgDCLZQH39QHHBlctkwx/b5egm sSUqEurnRtytp1eJItc8RDr6joH1i0iFECatNunzjpLHqhr+yl9vj+hSmWtlttjLZAHK 88ilEwqG/LHdHGirdjNRO0uFyQk8c73j55/ShznnyQFuEhjV2JTS1PhZLPOaHVcLt6nT hr3mulfwz6BoAqrRPz6az0anGknh9XW0ebDwzVm8w6te3Rn66dEmlg4Q0V4zEJd2plFx k1PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@auristor.com header.s=MDaemon header.b=WnfpxX3V; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=auristor.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a17090adc1500b00256750a8f18si175582pjv.137.2023.05.31.17.45.09; Wed, 31 May 2023 17:45:22 -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=fail header.i=@auristor.com header.s=MDaemon header.b=WnfpxX3V; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=auristor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbjFAAPn (ORCPT + 99 others); Wed, 31 May 2023 20:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjFAAPm (ORCPT ); Wed, 31 May 2023 20:15:42 -0400 Received: from sequoia-grove.ad.secure-endpoints.com (sequoia-grove.ad.secure-endpoints.com [IPv6:2001:470:1f07:f77:70f5:c082:a96a:5685]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED3B0121 for ; Wed, 31 May 2023 17:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/relaxed; d=auristor.com; s=MDaemon; r=y; t=1685578539; x=1686183339; i=jaltman@auristor.com; q=dns/txt; h=Message-ID:Date: MIME-Version:User-Agent:Subject:Content-Language:To:Cc: References:From:Organization:In-Reply-To:Content-Type; bh=Ba6Nfb AlZjooTNzC08xLujS6IOv8AY7/By4Y/0T23EY=; b=WnfpxX3VJ4RbVB387w2WAk KMdiNgkrss2f9tjLx9Qqqxa/Z7MfogETvMrWoQIyzfXOhJEGmiwpNLD2YV1o2x5A EELBmXqDqBYWAbLrblw8Ev+9nKNnOcFXckAnKLbtNTB74ckFvHVvEJNw/bgOUdmd n5oLmQj1DgyBWS3yOxHmI= X-MDAV-Result: clean X-MDAV-Processed: sequoia-grove.ad.secure-endpoints.com, Wed, 31 May 2023 20:15:39 -0400 Received: from [IPV6:2603:7000:73c:9c99:cc97:6df8:a457:33bf] by auristor.com (IPv6:2001:470:1f07:f77:28d9:68fb:855d:c2a5) (MDaemon PRO v23.0.2d) with ESMTPSA id md5001003481698.msg; Wed, 31 May 2023 20:15:38 -0400 X-Spam-Processed: sequoia-grove.ad.secure-endpoints.com, Wed, 31 May 2023 20:15:38 -0400 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 2603:7000:73c:9c99:cc97:6df8:a457:33bf X-MDHelo: [IPV6:2603:7000:73c:9c99:cc97:6df8:a457:33bf] X-MDArrival-Date: Wed, 31 May 2023 20:15:38 -0400 X-MDOrigin-Country: US, NA X-Authenticated-Sender: jaltman@auristor.com X-Return-Path: prvs=1516548fbb=jaltman@auristor.com X-Envelope-From: jaltman@auristor.com X-MDaemon-Deliver-To: linux-kernel@vger.kernel.org Message-ID: <7546a4b2-7421-990c-3165-bda80c637127@auristor.com> Date: Wed, 31 May 2023 20:15:33 -0400 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: [PATCH] afs: Fix setting of mtime when creating a file/dir/symlink Content-Language: en-US To: David Howells , Marc Dionne Cc: linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <808140.1685573412@warthog.procyon.org.uk> From: Jeffrey E Altman Organization: AuriStor, Inc. In-Reply-To: <808140.1685573412@warthog.procyon.org.uk> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms010903000007040704090906" X-MDCFSigsAdded: auristor.com X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,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 This is a cryptographically signed message in MIME format. --------------ms010903000007040704090906 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/31/2023 6:50 PM, David Howells wrote: > > kafs incorrectly passes a zero mtime (ie. 1st Jan 1970) to the server when > creating a file, dir or symlink because commit 52af7105eceb caused the > mtime recorded in the afs_operation struct to be passed to the server, but > didn't modify the afs_mkdir(), afs_create() and afs_symlink() functions to > set it first. > > Those functions were written with the assumption that the mtime would be > obtained from the server - but that fell foul of malsynchronised clocks, so > it was decided that the mtime should be set from the client instead. > > Fix this by filling in op->mtime before calling the create op. > > Fixes: 52af7105eceb ("afs: Set mtime from the client for yfs create operations") > Signed-off-by: David Howells > cc: Marc Dionne > cc: linux-afs@lists.infradead.org > cc: linux-fsdevel@vger.kernel.org > --- > fs/afs/dir.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/afs/dir.c b/fs/afs/dir.c > index 4dd97afa536c..5219182e52e1 100644 > --- a/fs/afs/dir.c > +++ b/fs/afs/dir.c > @@ -1358,6 +1358,7 @@ static int afs_mkdir(struct mnt_idmap *idmap, struct inode *dir, > op->dentry = dentry; > op->create.mode = S_IFDIR | mode; > op->create.reason = afs_edit_dir_for_mkdir; > + op->mtime = current_time(dir); > op->ops = &afs_mkdir_operation; > return afs_do_sync_operation(op); > } > @@ -1661,6 +1662,7 @@ static int afs_create(struct mnt_idmap *idmap, struct inode *dir, > op->dentry = dentry; > op->create.mode = S_IFREG | mode; > op->create.reason = afs_edit_dir_for_create; > + op->mtime = current_time(dir); > op->ops = &afs_create_operation; > return afs_do_sync_operation(op); > > @@ -1796,6 +1798,7 @@ static int afs_symlink(struct mnt_idmap *idmap, struct inode *dir, > op->ops = &afs_symlink_operation; > op->create.reason = afs_edit_dir_for_symlink; > op->create.symlink = content; > + op->mtime = current_time(dir); > return afs_do_sync_operation(op); > > error: > Reviewed-by: Jeffrey Altman --------------ms010903000007040704090906 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCC DHEwggXSMIIEuqADAgECAhBAAYJpmi/rPn/F0fJyDlzMMA0GCSqGSIb3DQEBCwUAMDoxCzAJ BgNVBAYTAlVTMRIwEAYDVQQKEwlJZGVuVHJ1c3QxFzAVBgNVBAMTDlRydXN0SUQgQ0EgQTEz MB4XDTIyMDgwNDE2MDQ0OFoXDTI1MTAzMTE2MDM0OFowcDEvMC0GCgmSJomT8ixkAQETH0Ew MTQxMEQwMDAwMDE4MjY5OUEyRkQyMDAwMjMzQ0QxGTAXBgNVBAMTEEplZmZyZXkgRSBBbHRt YW4xFTATBgNVBAoTDEF1cmlTdG9yIEluYzELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQCkC7PKBBZnQqDKPtZPMLAy77zo2DPvwtGnd1hNjPvbXrpGxU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