]> www.infradead.org Git - users/willy/xarray.git/commitdiff
smb: client: fix FSCTL_GET_REPARSE_POINT against NetApp
authorPaulo Alcantara <pc@manguebit.com>
Thu, 1 Aug 2024 21:12:39 +0000 (18:12 -0300)
committerSteve French <stfrench@microsoft.com>
Fri, 2 Aug 2024 15:56:02 +0000 (10:56 -0500)
NetApp server requires the file to be open with FILE_READ_EA access in
order to support FSCTL_GET_REPARSE_POINT, otherwise it will return
STATUS_INVALID_DEVICE_REQUEST.  It doesn't make any sense because
there's no requirement for FILE_READ_EA bit to be set nor
STATUS_INVALID_DEVICE_REQUEST being used for something other than
"unsupported reparse points" in MS-FSA.

To fix it and improve compatibility, set FILE_READ_EA & SYNCHRONIZE
bits to match what Windows client currently does.

Tested-by: Sebastian Steinbeisser <Sebastian.Steinbeisser@lrz.de>
Acked-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2inode.c

index 062b86a4936fd5a7aed4ef68bb4e6eb50ba8fcb7..9f5bc41433c15646278d4dc19115c6f0798d5c14 100644 (file)
@@ -950,7 +950,8 @@ int smb2_query_path_info(const unsigned int xid,
                        cmds[num_cmds++] = SMB2_OP_GET_REPARSE;
 
                oparms = CIFS_OPARMS(cifs_sb, tcon, full_path,
-                                    FILE_READ_ATTRIBUTES | FILE_READ_EA,
+                                    FILE_READ_ATTRIBUTES |
+                                    FILE_READ_EA | SYNCHRONIZE,
                                     FILE_OPEN, create_options |
                                     OPEN_REPARSE_POINT, ACL_NO_MODE);
                cifs_get_readable_path(tcon, full_path, &cfile);
@@ -1258,7 +1259,8 @@ int smb2_query_reparse_point(const unsigned int xid,
        cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path);
 
        cifs_get_readable_path(tcon, full_path, &cfile);
-       oparms = CIFS_OPARMS(cifs_sb, tcon, full_path, FILE_READ_ATTRIBUTES,
+       oparms = CIFS_OPARMS(cifs_sb, tcon, full_path,
+                            FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE,
                             FILE_OPEN, OPEN_REPARSE_POINT, ACL_NO_MODE);
        rc = smb2_compound_op(xid, tcon, cifs_sb,
                              full_path, &oparms, &in_iov,