linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cifs: open_cached_dir(): add FILE_READ_EA to desired access
@ 2024-03-01 14:53 Eugene Korenevsky
  2024-03-14  4:15 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Korenevsky @ 2024-03-01 14:53 UTC (permalink / raw)
  To: linux-cifs; +Cc: linux-kernel

Since smb2_query_eas() reads EA and uses cached directory,
open_cached_dir() should request FILE_READ_EA access.

Otherwise listxattr() and getxattr() will fail with EACCES
(0xc0000022 STATUS_ACCESS_DENIED SMB status).

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=218543
Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
---
 fs/smb/client/cached_dir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index 3de5047a7ff9..a0017724d523 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -239,7 +239,8 @@ 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_DATA | FILE_READ_ATTRIBUTES,
+		.desired_access =  FILE_READ_DATA | FILE_READ_ATTRIBUTES |
+				   FILE_READ_EA,
 		.disposition = FILE_OPEN,
 		.fid = pfid,
 		.replay = !!(retries),
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cifs: open_cached_dir(): add FILE_READ_EA to desired access
  2024-03-01 14:53 [PATCH] cifs: open_cached_dir(): add FILE_READ_EA to desired access Eugene Korenevsky
@ 2024-03-14  4:15 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2024-03-14  4:15 UTC (permalink / raw)
  To: Eugene Korenevsky, linux-cifs, linux-kernel

Tentatively merged into cifs-2.6.git for-next pending additional review/testing

Let me know if any updates to this

On Fri, Mar 1, 2024 at 8:54 AM Eugene Korenevsky
<ekorenevsky@astralinux.ru> wrote:
>
> Since smb2_query_eas() reads EA and uses cached directory,
> open_cached_dir() should request FILE_READ_EA access.
>
> Otherwise listxattr() and getxattr() will fail with EACCES
> (0xc0000022 STATUS_ACCESS_DENIED SMB status).
>
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=218543
> Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
> ---
>  fs/smb/client/cached_dir.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
> index 3de5047a7ff9..a0017724d523 100644
> --- a/fs/smb/client/cached_dir.c
> +++ b/fs/smb/client/cached_dir.c
> @@ -239,7 +239,8 @@ 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_DATA | FILE_READ_ATTRIBUTES,
> +               .desired_access =  FILE_READ_DATA | FILE_READ_ATTRIBUTES |
> +                                  FILE_READ_EA,
>                 .disposition = FILE_OPEN,
>                 .fid = pfid,
>                 .replay = !!(retries),
> --
> 2.30.2
>
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-14  4:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 14:53 [PATCH] cifs: open_cached_dir(): add FILE_READ_EA to desired access Eugene Korenevsky
2024-03-14  4:15 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).