]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: remove pointless cfid->has_lease check
authorHenrique Carvalho <henrique.carvalho@suse.com>
Fri, 19 Sep 2025 01:44:34 +0000 (22:44 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 2 Oct 2025 03:42:04 +0000 (22:42 -0500)
open_cached_dir() will only return a valid cfid, which has both
has_lease = true and time != 0.

Remove the pointless check of cfid->has_lease right after
open_cached_dir() returns no error.

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c

index 12792ddc6b0c7dc82fab7ba23eca79c5f61dddc3..058050f744c020ab05d031474ac26ee2b000e554 100644 (file)
@@ -954,11 +954,8 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
 
        rc = open_cached_dir(xid, tcon, full_path, cifs_sb, true, &cfid);
        if (!rc) {
-               if (cfid->has_lease) {
-                       close_cached_dir(cfid);
-                       return 0;
-               }
                close_cached_dir(cfid);
+               return 0;
        }
 
        utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb);