cifs: update desired access while requesting for directory lease
authorBharath SM <bharathsm@microsoft.com>
Wed, 16 Aug 2023 19:38:45 +0000 (19:38 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:27:57 +0000 (12:27 +0200)
commit b6d44d42313baa45a81ce9b299aeee2ccf3d0ee1 upstream.

We read and cache directory contents when we get directory
lease, so we should ask for read permission to read contents
of directory.

Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/cached_dir.c

index bfc964b36c72ecaa9da088892be7349731b327dc..5a132c1e6f6c4def3b4d80f3d10cfd8e00ce4511 100644 (file)
@@ -218,7 +218,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
                .tcon = tcon,
                .path = path,
                .create_options = cifs_create_options(cifs_sb, CREATE_NOT_FILE),
-               .desired_access = FILE_READ_ATTRIBUTES,
+               .desired_access =  FILE_READ_DATA | FILE_READ_ATTRIBUTES,
                .disposition = FILE_OPEN,
                .fid = pfid,
        };