From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E40C6FD6 for ; Thu, 28 Dec 2023 12:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YRhNfZnM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC494C433C8; Thu, 28 Dec 2023 12:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703765427; bh=fn2RuN7CHRhNEmBidectZh3zqoLCxy46ZmyyOyklBtw=; h=Subject:To:Cc:From:Date:From; b=YRhNfZnMB8iBT8GKQamOuN4RW5PIHcCfjupGJiPbT9f4j5rj9czoTxGZ+VyGOga7K Pp3U+aC7mfxZO3DDIfOyMoDVWLmfN2Q9nGyu9NtLu5LpIbTj1h4Q5NUAdzlc/Oqa7V 2GdZa1foNKgBMbNveurQR39huGmWxFrvD33as8QI= Subject: FAILED: patch "[PATCH] fs: cifs: Fix atime update check" failed to apply to 5.15-stable tree To: wozizhi@huawei.com,stfrench@microsoft.com Cc: From: Date: Thu, 28 Dec 2023 12:10:21 +0000 Message-ID: <2023122821-hedge-chug-be5d@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 01fe654f78fd1ea4df046ef76b07ba92a35f8dbe # git commit -s git send-email --to '' --in-reply-to '2023122821-hedge-chug-be5d@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: 01fe654f78fd ("fs: cifs: Fix atime update check") 8f22ce708883 ("client: convert to new timestamp accessors") 9448765397b6 ("smb: convert to ctime accessor functions") bc2390f2c884 ("cifs: update the ctime on a partial page write") 38c8a9a52082 ("smb: move client and server files to common directory fs/smb") abdb1742a312 ("cifs: get rid of mount options string parsing") 9fd29a5bae6e ("cifs: use fs_context for automounts") 5dd8ce24667a ("cifs: missing directory in MAINTAINERS file") 332019e23a51 ("Merge tag '5.20-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 01fe654f78fd1ea4df046ef76b07ba92a35f8dbe Mon Sep 17 00:00:00 2001 From: Zizhi Wo Date: Wed, 13 Dec 2023 10:23:53 +0800 Subject: [PATCH] fs: cifs: Fix atime update check Commit 9b9c5bea0b96 ("cifs: do not return atime less than mtime") indicates 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") Cc: stable@vger.kernel.org Signed-off-by: Zizhi Wo Signed-off-by: Steve French 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 = inode_set_atime_to_ts(inode, current_time(inode)); mtime = 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)