Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp41954rdb; Fri, 15 Dec 2023 22:24:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IENzEeVqzH1v1xyQK3WmCA0cCzHxUT/2LcGTM2IvYoO14tgooz6bWVfJLOk0Toak8N2kbxr X-Received: by 2002:ac8:5703:0:b0:425:4042:f442 with SMTP id 3-20020ac85703000000b004254042f442mr18534668qtw.38.1702707886128; Fri, 15 Dec 2023 22:24:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702707886; cv=none; d=google.com; s=arc-20160816; b=OEcxpKH7wIB0Gry5Kc0r4hIvax8UUzWLpoXtMhVUCShPcpd3cptTwh9XSTLe0FBrL/ rF3DppBsfGagecUNC9EKn47bl5v7eX8bF/gMCbFil1wsxfm2JyuiMuvoaPYWoUBSDkKA 6C7eJ7FGHDODsAnmIDpoePh0G+Ffzb/RRfNS4bZj4LOClM0ZKEscHu3+2Tm5/miesx2q CDhRjk4ETl/Nm3u05dp2CjeizSLz8WEHuxXX/yyC4Y08ZhqxelJto2Ap7Q3ke4iImVs1 YjkdFfGc3mghFuBm+DOxjZKmJwwcC7t6kdetRPHfJ2YU8lCAlSlcpz4JBM5cfqNeSLQs b2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Mvcews0bkmGQtLzZZHQH60WBefpCX2Y0ajeJT2rs0tM=; fh=lpGDV4eEJK39gSvJk3MYLuFvFVEtytjCP8VTC/8lrDk=; b=pdNvbIu0EK7MRVCBeUBIbiWyz1gN16fqZtJFOyW85EJf/hwNg40Yo/T71gJT38EXSr R2A/FhOiRbY4Akiy2VjqV4a5tcnRIe69vZOzaX66PHsEV5dmrscxlT+WILnERoItKD87 1JPM9UAnHRk6es2xh1EHsVKyLJjnaa0LUWJJejrau4Qb89cw17qpXJQ6MHOO5qwVyQC7 neOvf0YV1R0WpoopqjF1wi3VMxzdzBZAXTmruKirbSPyd8sMHAgZu1bdZuBhEvcL99w8 U6aCyL2ZE2Z1dT/gZX76KVPXk/6pbGuWmzD0kDRTUfP4ZAmRrrOK8J/hR3h9cinVQ8CS ZSJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Rh1M5133; spf=pass (google.com: domain of linux-kernel+bounces-2113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ki20-20020a05622a771400b0042402e827bfsi17558608qtb.315.2023.12.15.22.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 22:24:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Rh1M5133; spf=pass (google.com: domain of linux-kernel+bounces-2113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DC0871C23E46 for ; Sat, 16 Dec 2023 06:24:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D600912E4D; Sat, 16 Dec 2023 06:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rh1M5133" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D468B134A0; Sat, 16 Dec 2023 06:24:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-50bf3efe2cbso1624845e87.2; Fri, 15 Dec 2023 22:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702707875; x=1703312675; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Mvcews0bkmGQtLzZZHQH60WBefpCX2Y0ajeJT2rs0tM=; b=Rh1M5133cgcYKdFfFa0QWrQD4RGNESY9vcUA71iJm4fDXkkcQQOPWUZb9rKg35DnvJ 7d6jBPikoYvYg65JyoBjVwrIlDwCevc/zj3WkNZndCZwc3C+jWWUINb5xVjyAg50s8lh +EkZqYd78E+DaPUMH4CZxZ3eARB6GUwhKK4jnskN7zPGTEVkl52coapbXOxIXhiioUZ0 6FfEOwvyQtMR24oJ7eGfI0ie1rttk2KcCHa2vmY/lmcZE5Dmv3iPf7oyW6FXoxKpDjdh PD2Ysq8uG1tnIE2ogbr8CkuECPpoCUk7xUSf5jtq4TlWh1hclwHGbZ0v9MgE2C0PNKbo 0Q/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702707875; x=1703312675; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mvcews0bkmGQtLzZZHQH60WBefpCX2Y0ajeJT2rs0tM=; b=B7wf48NSeyEatDFI1Xf6eGQtuzkxDWSG/WwFbbqLDFxG4U6WtotDGvBWfhM8ZBcB3x NPkHVd8i3Lfvjlx0+dKPjMB0nGKx56Oxhn61TcTnET56m0LepHA+DjAJK/Glgx1YTvnU gSBumef8xFEGa8dV4jiRR2xeswXRXT8OTZFPKu/3b+Hf7fjsGFv6yIOKa89IZtYykZJq 2QQa3c9yVLYnlkHY5RxFZwoJwWBajDUcZyxsPCH8Y5aQMgNhLfR/VUW0T/S4fPah36Gy Pv/hubDbu/9pxiqSNlQ2M4kjrWuNQsR06lK8DQUoirf+6r1XqAibsGZy4H0mmJlB8Ydb pgkg== X-Gm-Message-State: AOJu0Yy14SqOoY7eQplPOQqhWQmTW8/mulgmyZVbtqCMtA1FjpZKURTo nor8RAbP5YcEKlsk5MwWsgpyDYqy9fUBYysYZD0= X-Received: by 2002:a05:6512:2829:b0:50b:f08f:8e8d with SMTP id cf41-20020a056512282900b0050bf08f8e8dmr3119231lfb.184.1702707874640; Fri, 15 Dec 2023 22:24:34 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231213022353.2983979-1-wozizhi@huawei.com> In-Reply-To: <20231213022353.2983979-1-wozizhi@huawei.com> From: Steve French Date: Sat, 16 Dec 2023 00:24:23 -0600 Message-ID: Subject: Re: [PATCH -next] fs: cifs: Fix atime update check To: Zizhi Wo Cc: stfrench@microsoft.com, lsahlber@redhat.com, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, yangerkun@huawei.com, Jeff Layton , Christian Brauner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable added to cifs-2.6.git for-next (and added Cc: stable) pending additional te= sting Adding @Christian Brauner and @Jeff Layton since this overlaps a recent change of theirs. On Tue, Dec 12, 2023 at 8:25=E2=80=AFPM Zizhi Wo wrote= : > > Commit 9b9c5bea0b96 ("cifs: do not return atime less than mtime") indicat= es > that in cifs, if atime is less than mtime, some apps will break. > Therefore, it introduce a function to compare this two variables in two > places where atime is updated. If atime is less than mtime, update it to > mtime. > > However, the patch was handled incorrectly, resulting in atime and mtime > being exactly equal. A previous commit 69738cfdfa70 ("fs: cifs: Fix atime > update check vs mtime") fixed one place and forgot to fix another. Fix it= . > > Fixes: 9b9c5bea0b96 ("cifs: do not return atime less than mtime") > Signed-off-by: Zizhi Wo > --- > fs/smb/client/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c > index cf17e3dd703e..32a8525415d9 100644 > --- a/fs/smb/client/file.c > +++ b/fs/smb/client/file.c > @@ -4671,7 +4671,7 @@ static int cifs_readpage_worker(struct file *file, = struct page *page, > /* we do not want atime to be less than mtime, it broke some apps= */ > atime =3D inode_set_atime_to_ts(inode, current_time(inode)); > mtime =3D inode_get_mtime(inode); > - if (timespec64_compare(&atime, &mtime)) > + if (timespec64_compare(&atime, &mtime) < 0) > inode_set_atime_to_ts(inode, inode_get_mtime(inode)); > > if (PAGE_SIZE > rc) > -- > 2.39.2 > > -- Thanks, Steve