Skip to contentSkip to conversation

cifs: update desired access while requesting for directory lease

PATCH In review Bharath SM 2 participants 3 messages Aug 16, 2023 – Aug 22, 2023

Subsystems (2)
lore
Share & tools
lore

Bharath SM

author
#0 lore raw

PATCH 1/1 cifs: update desired access while requesting for directory lease

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

---
 fs/smb/client/cached_dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cached_dir.c +1 -1
index fe483f163dbc..2d5e9a9d5b8b 100644
@@ -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,
 	};
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Bharath SM

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

---
 fs/smb/client/cached_dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cached_dir.c +1 -2
index fe483f163dbc..2d5e9a9d5b8b 100644
@@ -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,
        };
--
Quoted 2 lines

2.39.2

Looks good to me.
Should also CC stable.

Signature · 2 lines
Regards,
Shyam
author
#2 lore raw

Adding [email protected]

Quoted 37 lines · Shyam Prasad N
Quoted 24 lines · Bharath SM

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

---
 fs/smb/client/cached_dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cached_dir.c +1 -2
index fe483f163dbc..2d5e9a9d5b8b 100644
@@ -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,
        };
--
Quoted 2 lines

2.39.2

Looks good to me.
Should also CC stable.

--
Regards,
Shyam