diff mbox series

[CIFS] Clear modified attribute bit from inode flags

Message ID CAH2r5mtJMSL39-19t_s8znmRC3UaCnhv1MRGdWJrLrDJqOU+JA@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [CIFS] Clear modified attribute bit from inode flags | expand

Commit Message

Steve French Sept. 23, 2021, 8:44 p.m. UTC
Added Cc: stable@vger.kernel.org # 5.13+ since it fixes a problem with
git regression tests and deferred close (which went in 5.13).and
merged into cifs-2.6.git for-next pending testing

See attached.

    Clear CIFS_INO_MODIFIED_ATTR bit from inode flags after
    updating mtime and ctime
diff mbox series

Patch

From 233ca166a21629b3c884f5d764af93455fdb8638 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Thu, 23 Sep 2021 12:42:35 -0500
Subject: [PATCH] cifs: Clear modified attribute bit from inode flags

Clear CIFS_INO_MODIFIED_ATTR bit from inode flags after
updating mtime and ctime

Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: stable@vger.kernel.org # 5.13+
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 0ab5bb24b8ca..13f3182cf796 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -884,7 +884,7 @@  int cifs_close(struct inode *inode, struct file *file)
 		    cinode->lease_granted &&
 		    !test_bit(CIFS_INO_CLOSE_ON_LOCK, &cinode->flags) &&
 		    dclose) {
-			if (test_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) {
+			if (test_and_clear_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) {
 				inode->i_ctime = inode->i_mtime = current_time(inode);
 				cifs_fscache_update_inode_cookie(inode);
 			}
-- 
2.30.2