diff mbox series

cifs: update desired access while requesting for directory lease

Message ID 20230816202638.17616-1-bharathsm@microsoft.com (mailing list archive)
State New, archived
Headers show
Series cifs: update desired access while requesting for directory lease | expand

Commit Message

Bharath SM Aug. 16, 2023, 8:26 p.m. UTC
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>
---
 fs/smb/client/cached_dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shyam Prasad N Aug. 17, 2023, 9:42 a.m. UTC | #1
On Thu, Aug 17, 2023 at 1:58 AM Bharath SM <bharathsm.hsk@gmail.com> wrote:
>
> 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>
> ---
>  fs/smb/client/cached_dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
> index fe483f163dbc..2d5e9a9d5b8b 100644
> --- a/fs/smb/client/cached_dir.c
> +++ b/fs/smb/client/cached_dir.c
> @@ -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,
>         };
> --
> 2.39.2
>

Looks good to me.
Should also CC stable.

Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Bharath SM Aug. 22, 2023, 3:09 p.m. UTC | #2
Adding smfrench@gmail.com

On Thu, Aug 17, 2023 at 3:12 PM Shyam Prasad N <nspmangalore@gmail.com> wrote:
>
> On Thu, Aug 17, 2023 at 1:58 AM Bharath SM <bharathsm.hsk@gmail.com> wrote:
> >
> > 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>
> > ---
> >  fs/smb/client/cached_dir.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
> > index fe483f163dbc..2d5e9a9d5b8b 100644
> > --- a/fs/smb/client/cached_dir.c
> > +++ b/fs/smb/client/cached_dir.c
> > @@ -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,
> >         };
> > --
> > 2.39.2
> >
>
> Looks good to me.
> Should also CC stable.
>
> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
>
> --
> Regards,
> Shyam
diff mbox series

Patch

diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index fe483f163dbc..2d5e9a9d5b8b 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -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,
 	};