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)
committerSteve French <stfrench@microsoft.com>
Tue, 22 Aug 2023 15:31:00 +0000 (10:31 -0500)
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>
fs/smb/client/cached_dir.c

index fe483f163dbc81accde0d20a732c06307a0277e9..2d5e9a9d5b8be31e7cf7db6fc34ecb69fcaf1934 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,
        };