]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: Clear modified attribute bit from inode flags
authorSteve French <stfrench@microsoft.com>
Thu, 23 Sep 2021 17:42:35 +0000 (12:42 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 23 Sep 2021 21:16:19 +0000 (16:16 -0500)
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>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Cc: stable@vger.kernel.org # 5.13+
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/file.c

index 0ab5bb24b8ca1520fffcb143d51e11ee2de9e99b..13f3182cf7969a207fcb158ce387ed30e7350a88 100644 (file)
@@ -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);
                        }