]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb client: fix bug with newly created file in cached dir
authorBharath SM <bharathsm@microsoft.com>
Fri, 26 Sep 2025 15:13:50 +0000 (10:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:37:31 +0000 (16:37 +0200)
commit aa12118dbcfe659697567c9daa0eac2c71e3fd37 upstream.

Test generic/637 spotted a problem with create of a new file in a
cached directory (by the same client) could cause cases where the
new file does not show up properly in ls on that client until the
lease times out.

Fixes: 037e1bae588e ("smb: client: use ParentLeaseKey in cifs_do_create")
Cc: stable@vger.kernel.org
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/dir.c

index 5223edf6d11a5b87d799e0e70d6becffda456c42..26117b147eac6e01da6bf6b01523dfce5d803b13 100644 (file)
@@ -329,6 +329,7 @@ retry_open:
                                               parent_cfid->fid.lease_key,
                                               SMB2_LEASE_KEY_SIZE);
                                        parent_cfid->dirents.is_valid = false;
+                                       parent_cfid->dirents.is_failed = true;
                                }
                                break;
                        }