Merge tag '6.15-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull more smb client updates from Steve French:

- reconnect fixes: three for updating rsize/wsize and an SMB1 reconnect
fix

- RFC1001 fixes: fixing connections to nonstandard ports, and negprot
retries

- fix mfsymlinks to old servers

- make mapping of open flags for SMB1 more accurate

- permission fixes: adding retry on open for write, and one for stat to
workaround unexpected access denied

- add two new xattrs, one for retrieving SACL and one for retrieving
owner (without having to retrieve the whole ACL)

- fix mount parm validation for echo_interval

- minor cleanup (including removing now unneeded cifs_truncate_page)

* tag '6.15-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: update internal version number
cifs: Implement is_network_name_deleted for SMB1
cifs: Remove cifs_truncate_page() as it should be superfluous
cifs: Do not add FILE_READ_ATTRIBUTES when using GENERIC_READ/EXECUTE/ALL
cifs: Improve SMB2+ stat() to work also without FILE_READ_ATTRIBUTES
cifs: Add fallback for SMB2 CREATE without FILE_READ_ATTRIBUTES
cifs: Fix querying and creating MF symlinks over SMB1
cifs: Fix access_flags_to_smbopen_mode
cifs: Fix negotiate retry functionality
cifs: Improve handling of NetBIOS packets
cifs: Allow to disable or force initialization of NetBIOS session
cifs: Add a new xattr system.smb3_ntsd_owner for getting or setting owner
cifs: Add a new xattr system.smb3_ntsd_sacl for getting or setting SACLs
smb: client: Update IO sizes after reconnection
smb: client: Store original IO parameters and prevent zero IO sizes
smb:client: smb: client: Add reverse mapping from tcon to superblocks
cifs: remove unreachable code in cifs_get_tcp_session()
cifs: fix integer overflow in match_server()

+437 -85
+1
fs/smb/client/cifs_fs_sb.h
··· 49 49 50 50 struct cifs_sb_info { 51 51 struct rb_root tlink_tree; 52 + struct list_head tcon_sb_link; 52 53 spinlock_t tlink_tree_lock; 53 54 struct tcon_link *master_tlink; 54 55 struct nls_table *local_nls;
+2 -3
fs/smb/client/cifsfs.h
··· 135 135 136 136 extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); 137 137 extern void cifs_setsize(struct inode *inode, loff_t offset); 138 - extern int cifs_truncate_page(struct address_space *mapping, loff_t from); 139 138 140 139 struct smb3_fs_context; 141 140 extern struct dentry *cifs_smb3_do_mount(struct file_system_type *fs_type, ··· 145 146 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 146 147 147 148 /* when changing internal version - update following two lines at same time */ 148 - #define SMB3_PRODUCT_BUILD 53 149 - #define CIFS_VERSION "2.53" 149 + #define SMB3_PRODUCT_BUILD 54 150 + #define CIFS_VERSION "2.54" 150 151 #endif /* _CIFSFS_H */
+6 -1
fs/smb/client/cifsglob.h
··· 714 714 spinlock_t srv_lock; /* protect anything here that is not protected */ 715 715 __u64 conn_id; /* connection identifier (useful for debugging) */ 716 716 int srv_count; /* reference counter */ 717 + int rfc1001_sessinit; /* whether to estasblish netbios session */ 718 + bool with_rfc1001; /* if netbios session is used */ 717 719 /* 15 character server name + 0x20 16th byte indicating type = srv */ 718 720 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 719 721 struct smb_version_operations *ops; ··· 1323 1321 #endif 1324 1322 struct list_head pending_opens; /* list of incomplete opens */ 1325 1323 struct cached_fids *cfids; 1326 - /* BB add field for back pointer to sb struct(s)? */ 1324 + struct list_head cifs_sb_list; 1325 + spinlock_t sb_list_lock; 1327 1326 #ifdef CONFIG_CIFS_DFS_UPCALL 1328 1327 struct delayed_work dfs_cache_work; 1329 1328 struct list_head dfs_ses_list; ··· 1721 1718 void *resp_buf; /* pointer to received SMB header */ 1722 1719 unsigned int resp_buf_size; 1723 1720 int mid_state; /* wish this were enum but can not pass to wait_event */ 1721 + int mid_rc; /* rc for MID_RC */ 1724 1722 unsigned int mid_flags; 1725 1723 __le16 command; /* smb command code */ 1726 1724 unsigned int optype; /* operation type */ ··· 1884 1880 #define MID_RESPONSE_MALFORMED 0x10 1885 1881 #define MID_SHUTDOWN 0x20 1886 1882 #define MID_RESPONSE_READY 0x40 /* ready for other process handle the rsp */ 1883 + #define MID_RC 0x80 /* mid_rc contains custom rc */ 1887 1884 1888 1885 /* Flags */ 1889 1886 #define MID_WAIT_CANCELLED 1 /* Cancelled while waiting for response */
+23 -7
fs/smb/client/cifssmb.c
··· 1041 1041 static int 1042 1042 access_flags_to_smbopen_mode(const int access_flags) 1043 1043 { 1044 - int masked_flags = access_flags & (GENERIC_READ | GENERIC_WRITE); 1044 + /* 1045 + * SYSTEM_SECURITY grants both read and write access to SACL, treat is as read/write. 1046 + * MAXIMUM_ALLOWED grants as many access as possible, so treat it as read/write too. 1047 + * SYNCHRONIZE as is does not grant any specific access, so do not check its mask. 1048 + * If only SYNCHRONIZE bit is specified then fallback to read access. 1049 + */ 1050 + bool with_write_flags = access_flags & (FILE_WRITE_DATA | FILE_APPEND_DATA | FILE_WRITE_EA | 1051 + FILE_DELETE_CHILD | FILE_WRITE_ATTRIBUTES | DELETE | 1052 + WRITE_DAC | WRITE_OWNER | SYSTEM_SECURITY | 1053 + MAXIMUM_ALLOWED | GENERIC_WRITE | GENERIC_ALL); 1054 + bool with_read_flags = access_flags & (FILE_READ_DATA | FILE_READ_EA | FILE_EXECUTE | 1055 + FILE_READ_ATTRIBUTES | READ_CONTROL | 1056 + SYSTEM_SECURITY | MAXIMUM_ALLOWED | GENERIC_ALL | 1057 + GENERIC_EXECUTE | GENERIC_READ); 1058 + bool with_execute_flags = access_flags & (FILE_EXECUTE | MAXIMUM_ALLOWED | GENERIC_ALL | 1059 + GENERIC_EXECUTE); 1045 1060 1046 - if (masked_flags == GENERIC_READ) 1047 - return SMBOPEN_READ; 1048 - else if (masked_flags == GENERIC_WRITE) 1061 + if (with_write_flags && with_read_flags) 1062 + return SMBOPEN_READWRITE; 1063 + else if (with_write_flags) 1049 1064 return SMBOPEN_WRITE; 1050 - 1051 - /* just go for read/write */ 1052 - return SMBOPEN_READWRITE; 1065 + else if (with_execute_flags) 1066 + return SMBOPEN_EXECUTE; 1067 + else 1068 + return SMBOPEN_READ; 1053 1069 } 1054 1070 1055 1071 int
+157 -23
fs/smb/client/connect.c
··· 371 371 * 372 372 */ 373 373 static int __cifs_reconnect(struct TCP_Server_Info *server, 374 - bool mark_smb_session) 374 + bool mark_smb_session, bool once) 375 375 { 376 376 int rc = 0; 377 377 ··· 399 399 if (rc) { 400 400 cifs_server_unlock(server); 401 401 cifs_dbg(FYI, "%s: reconnect error %d\n", __func__, rc); 402 + /* If was asked to reconnect only once, do not try it more times */ 403 + if (once) 404 + break; 402 405 msleep(3000); 403 406 } else { 404 407 atomic_inc(&tcpSesReconnectCount); ··· 567 564 return rc; 568 565 } 569 566 570 - int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session) 567 + static int 568 + _cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session, bool once) 571 569 { 572 570 if (!server->leaf_fullpath) 573 - return __cifs_reconnect(server, mark_smb_session); 571 + return __cifs_reconnect(server, mark_smb_session, once); 574 572 return reconnect_dfs_server(server); 575 573 } 576 574 #else 577 - int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session) 575 + static int 576 + _cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session, bool once) 578 577 { 579 - return __cifs_reconnect(server, mark_smb_session); 578 + return __cifs_reconnect(server, mark_smb_session, once); 580 579 } 581 580 #endif 581 + 582 + int 583 + cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session) 584 + { 585 + return _cifs_reconnect(server, mark_smb_session, false); 586 + } 587 + 588 + static int 589 + cifs_reconnect_once(struct TCP_Server_Info *server) 590 + { 591 + return _cifs_reconnect(server, true, true); 592 + } 582 593 583 594 static void 584 595 cifs_echo_request(struct work_struct *work) ··· 820 803 /* Regular SMB response */ 821 804 return true; 822 805 case RFC1002_SESSION_KEEP_ALIVE: 806 + /* 807 + * RFC 1002 session keep alive can sent by the server only when 808 + * we established a RFC 1002 session. But Samba servers send 809 + * RFC 1002 session keep alive also over port 445 on which 810 + * RFC 1002 session is not established. 811 + */ 823 812 cifs_dbg(FYI, "RFC 1002 session keep alive\n"); 824 813 break; 825 814 case RFC1002_POSITIVE_SESSION_RESPONSE: 826 - cifs_dbg(FYI, "RFC 1002 positive session response\n"); 815 + /* 816 + * RFC 1002 positive session response cannot be returned 817 + * for SMB request. RFC 1002 session response is handled 818 + * exclusively in ip_rfc1001_connect() function. 819 + */ 820 + cifs_server_dbg(VFS, "RFC 1002 positive session response (unexpected)\n"); 821 + cifs_reconnect(server, true); 827 822 break; 828 823 case RFC1002_NEGATIVE_SESSION_RESPONSE: 829 824 /* 830 825 * We get this from Windows 98 instead of an error on 831 - * SMB negprot response. 826 + * SMB negprot response, when we have not established 827 + * RFC 1002 session (which means ip_rfc1001_connect() 828 + * was skipped). Note that same still happens with 829 + * Windows Server 2022 when connecting via port 139. 830 + * So for this case when mount option -o nonbsessinit 831 + * was not specified, try to reconnect with establishing 832 + * RFC 1002 session. If new socket establishment with 833 + * RFC 1002 session was successful then return to the 834 + * mid's caller -EAGAIN, so it can retry the request. 832 835 */ 833 - cifs_dbg(FYI, "RFC 1002 negative session response\n"); 834 - /* give server a second to clean up */ 835 - msleep(1000); 836 - /* 837 - * Always try 445 first on reconnect since we get NACK 838 - * on some if we ever connected to port 139 (the NACK 839 - * is since we do not begin with RFC1001 session 840 - * initialize frame). 841 - */ 842 - cifs_set_port((struct sockaddr *)&server->dstaddr, CIFS_PORT); 836 + if (!cifs_rdma_enabled(server) && 837 + server->tcpStatus == CifsInNegotiate && 838 + !server->with_rfc1001 && 839 + server->rfc1001_sessinit != 0) { 840 + int rc, mid_rc; 841 + struct mid_q_entry *mid, *nmid; 842 + LIST_HEAD(dispose_list); 843 + 844 + cifs_dbg(FYI, "RFC 1002 negative session response during SMB Negotiate, retrying with NetBIOS session\n"); 845 + 846 + /* 847 + * Before reconnect, delete all pending mids for this 848 + * server, so reconnect would not signal connection 849 + * aborted error to mid's callbacks. Note that for this 850 + * server there should be exactly one pending mid 851 + * corresponding to SMB1/SMB2 Negotiate packet. 852 + */ 853 + spin_lock(&server->mid_lock); 854 + list_for_each_entry_safe(mid, nmid, &server->pending_mid_q, qhead) { 855 + kref_get(&mid->refcount); 856 + list_move(&mid->qhead, &dispose_list); 857 + mid->mid_flags |= MID_DELETED; 858 + } 859 + spin_unlock(&server->mid_lock); 860 + 861 + /* Now try to reconnect once with NetBIOS session. */ 862 + server->with_rfc1001 = true; 863 + rc = cifs_reconnect_once(server); 864 + 865 + /* 866 + * If reconnect was successful then indicate -EAGAIN 867 + * to mid's caller. If reconnect failed with -EAGAIN 868 + * then mask it as -EHOSTDOWN, so mid's caller would 869 + * know that it failed. 870 + */ 871 + if (rc == 0) 872 + mid_rc = -EAGAIN; 873 + else if (rc == -EAGAIN) 874 + mid_rc = -EHOSTDOWN; 875 + else 876 + mid_rc = rc; 877 + 878 + /* 879 + * After reconnect (either successful or unsuccessful) 880 + * deliver reconnect status to mid's caller via mid's 881 + * callback. Use MID_RC state which indicates that the 882 + * return code should be read from mid_rc member. 883 + */ 884 + list_for_each_entry_safe(mid, nmid, &dispose_list, qhead) { 885 + list_del_init(&mid->qhead); 886 + mid->mid_rc = mid_rc; 887 + mid->mid_state = MID_RC; 888 + mid->callback(mid); 889 + release_mid(mid); 890 + } 891 + 892 + /* 893 + * If reconnect failed then wait two seconds. In most 894 + * cases we were been called from the mount context and 895 + * delivered failure to mid's callback will stop this 896 + * receiver task thread and fails the mount process. 897 + * So wait two seconds to prevent another reconnect 898 + * in this task thread, which would be useless as the 899 + * mount context will fail at all. 900 + */ 901 + if (rc != 0) 902 + msleep(2000); 903 + } else { 904 + cifs_server_dbg(VFS, "RFC 1002 negative session response (unexpected)\n"); 905 + cifs_reconnect(server, true); 906 + } 907 + break; 908 + case RFC1002_RETARGET_SESSION_RESPONSE: 909 + cifs_server_dbg(VFS, "RFC 1002 retarget session response (unexpected)\n"); 843 910 cifs_reconnect(server, true); 844 911 break; 845 912 default: ··· 1802 1701 ctx->source_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL); 1803 1702 memcpy(tcp_ses->server_RFC1001_name, 1804 1703 ctx->target_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL); 1704 + tcp_ses->rfc1001_sessinit = ctx->rfc1001_sessinit; 1705 + tcp_ses->with_rfc1001 = false; 1805 1706 tcp_ses->session_estab = false; 1806 1707 tcp_ses->sequence_number = 0; 1807 1708 tcp_ses->channel_sequence_num = 0; /* only tracked for primary channel */ ··· 1834 1731 */ 1835 1732 tcp_ses->tcpStatus = CifsNew; 1836 1733 ++tcp_ses->srv_count; 1734 + tcp_ses->echo_interval = ctx->echo_interval * HZ; 1837 1735 1838 - if (ctx->echo_interval >= SMB_ECHO_INTERVAL_MIN && 1839 - ctx->echo_interval <= SMB_ECHO_INTERVAL_MAX) 1840 - tcp_ses->echo_interval = ctx->echo_interval * HZ; 1841 - else 1842 - tcp_ses->echo_interval = SMB_ECHO_INTERVAL_DEFAULT * HZ; 1843 1736 if (tcp_ses->rdma) { 1844 1737 #ifndef CONFIG_CIFS_SMB_DIRECT 1845 1738 cifs_dbg(VFS, "CONFIG_CIFS_SMB_DIRECT is not enabled\n"); ··· 3320 3221 return -EIO; 3321 3222 } 3322 3223 3224 + server->with_rfc1001 = true; 3323 3225 return 0; 3324 3226 } 3325 3227 ··· 3432 3332 return rc; 3433 3333 } 3434 3334 trace_smb3_connect_done(server->hostname, server->conn_id, &server->dstaddr); 3435 - if (sport == htons(RFC1001_PORT)) 3335 + 3336 + /* 3337 + * Establish RFC1001 NetBIOS session when it was explicitly requested 3338 + * by mount option -o nbsessinit, or when connecting to default RFC1001 3339 + * server port (139) and it was not explicitly disabled by mount option 3340 + * -o nonbsessinit. 3341 + */ 3342 + if (server->with_rfc1001 || 3343 + server->rfc1001_sessinit == 1 || 3344 + (server->rfc1001_sessinit == -1 && sport == htons(RFC1001_PORT))) 3436 3345 rc = ip_rfc1001_connect(server); 3437 3346 3438 3347 return rc; ··· 3590 3481 struct smb3_fs_context *ctx = cifs_sb->ctx; 3591 3482 3592 3483 INIT_DELAYED_WORK(&cifs_sb->prune_tlinks, cifs_prune_tlinks); 3484 + INIT_LIST_HEAD(&cifs_sb->tcon_sb_link); 3593 3485 3594 3486 spin_lock_init(&cifs_sb->tlink_tree_lock); 3595 3487 cifs_sb->tlink_tree = RB_ROOT; ··· 3822 3712 spin_lock(&cifs_sb->tlink_tree_lock); 3823 3713 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); 3824 3714 spin_unlock(&cifs_sb->tlink_tree_lock); 3715 + 3716 + spin_lock(&tcon->sb_list_lock); 3717 + list_add(&cifs_sb->tcon_sb_link, &tcon->cifs_sb_list); 3718 + spin_unlock(&tcon->sb_list_lock); 3825 3719 3826 3720 queue_delayed_work(cifsiod_wq, &cifs_sb->prune_tlinks, 3827 3721 TLINK_IDLE_EXPIRE); ··· 4168 4054 struct rb_root *root = &cifs_sb->tlink_tree; 4169 4055 struct rb_node *node; 4170 4056 struct tcon_link *tlink; 4057 + struct cifs_tcon *tcon = NULL; 4171 4058 4172 4059 cancel_delayed_work_sync(&cifs_sb->prune_tlinks); 4060 + 4061 + if (cifs_sb->master_tlink) { 4062 + tcon = cifs_sb->master_tlink->tl_tcon; 4063 + if (tcon) { 4064 + spin_lock(&tcon->sb_list_lock); 4065 + list_del_init(&cifs_sb->tcon_sb_link); 4066 + spin_unlock(&tcon->sb_list_lock); 4067 + } 4068 + } 4173 4069 4174 4070 spin_lock(&cifs_sb->tlink_tree_lock); 4175 4071 while ((node = rb_first(root))) { ··· 4202 4078 cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses, 4203 4079 struct TCP_Server_Info *server) 4204 4080 { 4081 + bool in_retry = false; 4205 4082 int rc = 0; 4206 4083 4207 4084 if (!server->ops->need_neg || !server->ops->negotiate) 4208 4085 return -ENOSYS; 4209 4086 4087 + retry: 4210 4088 /* only send once per connect */ 4211 4089 spin_lock(&server->srv_lock); 4212 4090 if (server->tcpStatus != CifsGood && ··· 4228 4102 spin_unlock(&server->srv_lock); 4229 4103 4230 4104 rc = server->ops->negotiate(xid, ses, server); 4105 + if (rc == -EAGAIN) { 4106 + /* Allow one retry attempt */ 4107 + if (!in_retry) { 4108 + in_retry = true; 4109 + goto retry; 4110 + } 4111 + rc = -EHOSTDOWN; 4112 + } 4231 4113 if (rc == 0) { 4232 4114 spin_lock(&server->srv_lock); 4233 4115 if (server->tcpStatus == CifsInNegotiate)
+20 -1
fs/smb/client/fs_context.c
··· 135 135 fsparam_flag("witness", Opt_witness), 136 136 fsparam_flag_no("nativesocket", Opt_nativesocket), 137 137 fsparam_flag_no("unicode", Opt_unicode), 138 + fsparam_flag_no("nbsessinit", Opt_nbsessinit), 138 139 139 140 /* Mount options which take uid or gid */ 140 141 fsparam_uid("backupuid", Opt_backupuid), ··· 969 968 cifs_errorf(fc, "can not change unicode during remount\n"); 970 969 return -EINVAL; 971 970 } 971 + if (new_ctx->rfc1001_sessinit != old_ctx->rfc1001_sessinit) { 972 + cifs_errorf(fc, "can not change nbsessinit during remount\n"); 973 + return -EINVAL; 974 + } 972 975 973 976 return 0; 974 977 } ··· 1338 1333 case Opt_rsize: 1339 1334 ctx->rsize = result.uint_32; 1340 1335 ctx->got_rsize = true; 1336 + ctx->vol_rsize = ctx->rsize; 1341 1337 break; 1342 1338 case Opt_wsize: 1343 1339 ctx->wsize = result.uint_32; ··· 1354 1348 ctx->wsize, PAGE_SIZE); 1355 1349 } 1356 1350 } 1351 + ctx->vol_wsize = ctx->wsize; 1357 1352 break; 1358 1353 case Opt_acregmax: 1359 1354 if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) { ··· 1390 1383 ctx->closetimeo = HZ * result.uint_32; 1391 1384 break; 1392 1385 case Opt_echo_interval: 1386 + if (result.uint_32 < SMB_ECHO_INTERVAL_MIN || 1387 + result.uint_32 > SMB_ECHO_INTERVAL_MAX) { 1388 + cifs_errorf(fc, "echo interval is out of bounds\n"); 1389 + goto cifs_parse_mount_err; 1390 + } 1393 1391 ctx->echo_interval = result.uint_32; 1394 1392 break; 1395 1393 case Opt_snapshot: ··· 1613 1601 /* The string has 16th byte zero still from set at top of function */ 1614 1602 if (i == RFC1001_NAME_LEN && param->string[i] != 0) 1615 1603 pr_warn("server netbiosname longer than 15 truncated\n"); 1604 + break; 1605 + case Opt_nbsessinit: 1606 + ctx->rfc1001_sessinit = !result.negated; 1607 + cifs_dbg(FYI, "rfc1001_sessinit set to %d\n", ctx->rfc1001_sessinit); 1616 1608 break; 1617 1609 case Opt_ver: 1618 1610 /* version of mount userspace tools, not dialect */ ··· 1905 1889 memset(ctx->source_rfc1001_name, 0x20, RFC1001_NAME_LEN); 1906 1890 for (i = 0; i < strnlen(nodename, RFC1001_NAME_LEN); i++) 1907 1891 ctx->source_rfc1001_name[i] = toupper(nodename[i]); 1908 - 1909 1892 ctx->source_rfc1001_name[RFC1001_NAME_LEN] = 0; 1893 + 1910 1894 /* 1911 1895 * null target name indicates to use *SMBSERVR default called name 1912 1896 * if we end up sending RFC1001 session initialize 1913 1897 */ 1914 1898 ctx->target_rfc1001_name[0] = 0; 1899 + 1900 + ctx->rfc1001_sessinit = -1; /* autodetect based on port number */ 1901 + 1915 1902 ctx->cred_uid = current_uid(); 1916 1903 ctx->linux_uid = current_uid(); 1917 1904 ctx->linux_gid = current_gid();
+5
fs/smb/client/fs_context.h
··· 174 174 Opt_iocharset, 175 175 Opt_netbiosname, 176 176 Opt_servern, 177 + Opt_nbsessinit, 177 178 Opt_ver, 178 179 Opt_vers, 179 180 Opt_sec, ··· 217 216 char *iocharset; /* local code page for mapping to and from Unicode */ 218 217 char source_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* clnt nb name */ 219 218 char target_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* srvr nb name */ 219 + int rfc1001_sessinit; 220 220 kuid_t cred_uid; 221 221 kuid_t linux_uid; 222 222 kgid_t linux_gid; ··· 282 280 bool use_client_guid:1; 283 281 /* reuse existing guid for multichannel */ 284 282 u8 client_guid[SMB2_CLIENT_GUID_SIZE]; 283 + /* User-specified original r/wsize value */ 284 + unsigned int vol_rsize; 285 + unsigned int vol_wsize; 285 286 unsigned int bsize; 286 287 unsigned int rasize; 287 288 unsigned int rsize;
-19
fs/smb/client/inode.c
··· 2901 2901 return -EOPNOTSUPP; 2902 2902 } 2903 2903 2904 - int cifs_truncate_page(struct address_space *mapping, loff_t from) 2905 - { 2906 - pgoff_t index = from >> PAGE_SHIFT; 2907 - unsigned offset = from & (PAGE_SIZE - 1); 2908 - struct page *page; 2909 - int rc = 0; 2910 - 2911 - page = grab_cache_page(mapping, index); 2912 - if (!page) 2913 - return -ENOMEM; 2914 - 2915 - zero_user_segment(page, offset, PAGE_SIZE); 2916 - unlock_page(page); 2917 - put_page(page); 2918 - return rc; 2919 - } 2920 - 2921 2904 void cifs_setsize(struct inode *inode, loff_t offset) 2922 2905 { 2923 2906 struct cifsInodeInfo *cifs_i = CIFS_I(inode); ··· 2995 3012 */ 2996 3013 attrs->ia_ctime = attrs->ia_mtime = current_time(inode); 2997 3014 attrs->ia_valid |= ATTR_CTIME | ATTR_MTIME; 2998 - 2999 - cifs_truncate_page(inode->i_mapping, inode->i_size); 3000 3015 } 3001 3016 3002 3017 return rc;
+4 -4
fs/smb/client/link.c
··· 258 258 struct cifs_open_parms oparms; 259 259 struct cifs_io_parms io_parms = {0}; 260 260 int buf_type = CIFS_NO_BUFFER; 261 - FILE_ALL_INFO file_info; 261 + struct cifs_open_info_data query_data; 262 262 263 263 oparms = (struct cifs_open_parms) { 264 264 .tcon = tcon, ··· 270 270 .fid = &fid, 271 271 }; 272 272 273 - rc = CIFS_open(xid, &oparms, &oplock, &file_info); 273 + rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, &query_data); 274 274 if (rc) 275 275 return rc; 276 276 277 - if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { 277 + if (query_data.fi.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { 278 278 rc = -ENOENT; 279 279 /* it's not a symlink */ 280 280 goto out; ··· 313 313 .fid = &fid, 314 314 }; 315 315 316 - rc = CIFS_open(xid, &oparms, &oplock, NULL); 316 + rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, NULL); 317 317 if (rc) 318 318 return rc; 319 319
+2
fs/smb/client/misc.c
··· 137 137 spin_lock_init(&ret_buf->tc_lock); 138 138 INIT_LIST_HEAD(&ret_buf->openFileList); 139 139 INIT_LIST_HEAD(&ret_buf->tcon_list); 140 + INIT_LIST_HEAD(&ret_buf->cifs_sb_list); 140 141 spin_lock_init(&ret_buf->open_file_lock); 141 142 spin_lock_init(&ret_buf->stat_lock); 143 + spin_lock_init(&ret_buf->sb_list_lock); 142 144 atomic_set(&ret_buf->num_local_opens, 0); 143 145 atomic_set(&ret_buf->num_remote_opens, 0); 144 146 ret_buf->stats_from_time = ktime_get_real_seconds();
+47 -10
fs/smb/client/smb1ops.c
··· 14 14 #include "cifspdu.h" 15 15 #include "cifs_unicode.h" 16 16 #include "fs_context.h" 17 + #include "nterr.h" 18 + #include "smberr.h" 17 19 18 20 /* 19 21 * An NT cancel request header looks just like the original request except: ··· 428 426 { 429 427 int rc; 430 428 rc = CIFSSMBNegotiate(xid, ses, server); 431 - if (rc == -EAGAIN) { 432 - /* retry only once on 1st time connection */ 433 - set_credits(server, 1); 434 - rc = CIFSSMBNegotiate(xid, ses, server); 435 - if (rc == -EAGAIN) 436 - rc = -EHOSTDOWN; 437 - } 438 429 return rc; 439 430 } 440 431 ··· 439 444 unsigned int wsize; 440 445 441 446 /* start with specified wsize, or default */ 442 - if (ctx->wsize) 443 - wsize = ctx->wsize; 447 + if (ctx->got_wsize) 448 + wsize = ctx->vol_wsize; 444 449 else if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) 445 450 wsize = CIFS_DEFAULT_IOSIZE; 446 451 else ··· 492 497 else 493 498 defsize = server->maxBuf - sizeof(READ_RSP); 494 499 495 - rsize = ctx->rsize ? ctx->rsize : defsize; 500 + rsize = ctx->got_rsize ? ctx->vol_rsize : defsize; 496 501 497 502 /* 498 503 * no CAP_LARGE_READ_X? Then MS-CIFS states that we must limit this to ··· 1064 1069 full_path, mode, dev); 1065 1070 } 1066 1071 1072 + static bool 1073 + cifs_is_network_name_deleted(char *buf, struct TCP_Server_Info *server) 1074 + { 1075 + struct smb_hdr *shdr = (struct smb_hdr *)buf; 1076 + struct TCP_Server_Info *pserver; 1077 + struct cifs_ses *ses; 1078 + struct cifs_tcon *tcon; 1079 + 1080 + if (shdr->Flags2 & SMBFLG2_ERR_STATUS) { 1081 + if (shdr->Status.CifsError != cpu_to_le32(NT_STATUS_NETWORK_NAME_DELETED)) 1082 + return false; 1083 + } else { 1084 + if (shdr->Status.DosError.ErrorClass != ERRSRV || 1085 + shdr->Status.DosError.Error != cpu_to_le16(ERRinvtid)) 1086 + return false; 1087 + } 1088 + 1089 + /* If server is a channel, select the primary channel */ 1090 + pserver = SERVER_IS_CHAN(server) ? server->primary_server : server; 1091 + 1092 + spin_lock(&cifs_tcp_ses_lock); 1093 + list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) { 1094 + if (cifs_ses_exiting(ses)) 1095 + continue; 1096 + list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { 1097 + if (tcon->tid == shdr->Tid) { 1098 + spin_lock(&tcon->tc_lock); 1099 + tcon->need_reconnect = true; 1100 + spin_unlock(&tcon->tc_lock); 1101 + spin_unlock(&cifs_tcp_ses_lock); 1102 + pr_warn_once("Server share %s deleted.\n", 1103 + tcon->tree_name); 1104 + return true; 1105 + } 1106 + } 1107 + } 1108 + spin_unlock(&cifs_tcp_ses_lock); 1109 + 1110 + return false; 1111 + } 1112 + 1067 1113 struct smb_version_operations smb1_operations = { 1068 1114 .send_cancel = send_nt_cancel, 1069 1115 .compare_fids = cifs_compare_fids, ··· 1189 1153 .get_acl_by_fid = get_cifs_acl_by_fid, 1190 1154 .set_acl = set_cifs_acl, 1191 1155 .make_node = cifs_make_node, 1156 + .is_network_name_deleted = cifs_is_network_name_deleted, 1192 1157 }; 1193 1158 1194 1159 struct smb_version_values smb1_values = {
+20 -1
fs/smb/client/smb2file.c
··· 152 152 int err_buftype = CIFS_NO_BUFFER; 153 153 struct cifs_fid *fid = oparms->fid; 154 154 struct network_resiliency_req nr_ioctl_req; 155 + bool retry_without_read_attributes = false; 155 156 156 157 smb2_path = cifs_convert_path_to_utf16(oparms->path, oparms->cifs_sb); 157 158 if (smb2_path == NULL) 158 159 return -ENOMEM; 159 160 160 - oparms->desired_access |= FILE_READ_ATTRIBUTES; 161 + /* 162 + * GENERIC_READ, GENERIC_EXECUTE, GENERIC_ALL and MAXIMUM_ALLOWED 163 + * contains also FILE_READ_ATTRIBUTES access right. So do not append 164 + * FILE_READ_ATTRIBUTES when not needed and prevent calling code path 165 + * for retry_without_read_attributes. 166 + */ 167 + if (!(oparms->desired_access & FILE_READ_ATTRIBUTES) && 168 + !(oparms->desired_access & GENERIC_READ) && 169 + !(oparms->desired_access & GENERIC_EXECUTE) && 170 + !(oparms->desired_access & GENERIC_ALL) && 171 + !(oparms->desired_access & MAXIMUM_ALLOWED)) { 172 + oparms->desired_access |= FILE_READ_ATTRIBUTES; 173 + retry_without_read_attributes = true; 174 + } 161 175 smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH; 162 176 163 177 rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov, 164 178 &err_buftype); 179 + if (rc == -EACCES && retry_without_read_attributes) { 180 + oparms->desired_access &= ~FILE_READ_ATTRIBUTES; 181 + rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov, 182 + &err_buftype); 183 + } 165 184 if (rc && data) { 166 185 struct smb2_hdr *hdr = err_iov.iov_base; 167 186
+1
fs/smb/client/smb2glob.h
··· 38 38 SMB2_OP_SET_REPARSE, 39 39 SMB2_OP_GET_REPARSE, 40 40 SMB2_OP_QUERY_WSL_EA, 41 + SMB2_OP_OPEN_QUERY, 41 42 }; 42 43 43 44 /* Used when constructing chained read requests. */
+66 -1
fs/smb/client/smb2inode.c
··· 176 176 struct kvec *out_iov, int *out_buftype, struct dentry *dentry) 177 177 { 178 178 179 + struct smb2_create_rsp *create_rsp = NULL; 179 180 struct smb2_query_info_rsp *qi_rsp = NULL; 180 181 struct smb2_compound_vars *vars = NULL; 181 182 __u8 oplock = SMB2_OPLOCK_LEVEL_NONE; ··· 266 265 num_rqst++; 267 266 rc = 0; 268 267 269 - for (i = 0; i < num_cmds; i++) { 268 + i = 0; 269 + 270 + /* Skip the leading explicit OPEN operation */ 271 + if (num_cmds > 0 && cmds[0] == SMB2_OP_OPEN_QUERY) 272 + i++; 273 + 274 + for (; i < num_cmds; i++) { 270 275 /* Operation */ 271 276 switch (cmds[i]) { 272 277 case SMB2_OP_QUERY_INFO: ··· 647 640 } 648 641 649 642 tmp_rc = rc; 643 + 644 + if (rc == 0 && num_cmds > 0 && cmds[0] == SMB2_OP_OPEN_QUERY) { 645 + create_rsp = rsp_iov[0].iov_base; 646 + idata = in_iov[0].iov_base; 647 + idata->fi.CreationTime = create_rsp->CreationTime; 648 + idata->fi.LastAccessTime = create_rsp->LastAccessTime; 649 + idata->fi.LastWriteTime = create_rsp->LastWriteTime; 650 + idata->fi.ChangeTime = create_rsp->ChangeTime; 651 + idata->fi.Attributes = create_rsp->FileAttributes; 652 + idata->fi.AllocationSize = create_rsp->AllocationSize; 653 + idata->fi.EndOfFile = create_rsp->EndofFile; 654 + if (le32_to_cpu(idata->fi.NumberOfLinks) == 0) 655 + idata->fi.NumberOfLinks = cpu_to_le32(1); /* dummy value */ 656 + idata->fi.DeletePending = 0; 657 + idata->fi.Directory = !!(le32_to_cpu(create_rsp->FileAttributes) & ATTR_DIRECTORY); 658 + 659 + /* smb2_parse_contexts() fills idata->fi.IndexNumber */ 660 + rc = smb2_parse_contexts(server, &rsp_iov[0], &oparms->fid->epoch, 661 + oparms->fid->lease_key, &oplock, &idata->fi, NULL); 662 + } 663 + 650 664 for (i = 0; i < num_cmds; i++) { 651 665 char *buf = rsp_iov[i + i].iov_base; 652 666 ··· 1005 977 switch (rc) { 1006 978 case 0: 1007 979 rc = parse_create_response(data, cifs_sb, full_path, &out_iov[0]); 980 + break; 981 + case -EACCES: 982 + /* 983 + * If SMB2_OP_QUERY_INFO (called when POSIX extensions are not used) failed with 984 + * STATUS_ACCESS_DENIED then it means that caller does not have permission to 985 + * open the path with FILE_READ_ATTRIBUTES access and therefore cannot issue 986 + * SMB2_OP_QUERY_INFO command. 987 + * 988 + * There is an alternative way how to query limited information about path but still 989 + * suitable for stat() syscall. SMB2 OPEN/CREATE operation returns in its successful 990 + * response subset of query information. 991 + * 992 + * So try to open the path without FILE_READ_ATTRIBUTES but with MAXIMUM_ALLOWED 993 + * access which will grant the maximum possible access to the file and the response 994 + * will contain required query information for stat() syscall. 995 + */ 996 + 997 + if (tcon->posix_extensions) 998 + break; 999 + 1000 + num_cmds = 1; 1001 + cmds[0] = SMB2_OP_OPEN_QUERY; 1002 + in_iov[0].iov_base = data; 1003 + in_iov[0].iov_len = sizeof(*data); 1004 + oparms = CIFS_OPARMS(cifs_sb, tcon, full_path, MAXIMUM_ALLOWED, 1005 + FILE_OPEN, create_options, ACL_NO_MODE); 1006 + free_rsp_iov(out_iov, out_buftype, ARRAY_SIZE(out_iov)); 1007 + rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, 1008 + &oparms, in_iov, cmds, num_cmds, 1009 + cfile, out_iov, out_buftype, NULL); 1010 + 1011 + hdr = out_iov[0].iov_base; 1012 + if (!hdr || out_buftype[0] == CIFS_NO_BUFFER) 1013 + goto out; 1014 + 1015 + if (!rc) 1016 + rc = parse_create_response(data, cifs_sb, full_path, &out_iov[0]); 1008 1017 break; 1009 1018 case -EOPNOTSUPP: 1010 1019 /*
+19 -13
fs/smb/client/smb2ops.c
··· 464 464 server->CurrentMid = 0; 465 465 spin_unlock(&server->mid_lock); 466 466 rc = SMB2_negotiate(xid, ses, server); 467 - /* BB we probably don't need to retry with modern servers */ 468 - if (rc == -EAGAIN) 469 - rc = -EHOSTDOWN; 470 467 return rc; 468 + } 469 + 470 + static inline unsigned int 471 + prevent_zero_iosize(unsigned int size, const char *type) 472 + { 473 + if (size == 0) { 474 + cifs_dbg(VFS, "SMB: Zero %ssize calculated, using minimum value %u\n", 475 + type, CIFS_MIN_DEFAULT_IOSIZE); 476 + return CIFS_MIN_DEFAULT_IOSIZE; 477 + } 478 + return size; 471 479 } 472 480 473 481 static unsigned int ··· 485 477 unsigned int wsize; 486 478 487 479 /* start with specified wsize, or default */ 488 - wsize = ctx->wsize ? ctx->wsize : CIFS_DEFAULT_IOSIZE; 480 + wsize = ctx->got_wsize ? ctx->vol_wsize : CIFS_DEFAULT_IOSIZE; 489 481 wsize = min_t(unsigned int, wsize, server->max_write); 490 482 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) 491 483 wsize = min_t(unsigned int, wsize, SMB2_MAX_BUFFER_SIZE); 492 484 493 - return wsize; 485 + return prevent_zero_iosize(wsize, "w"); 494 486 } 495 487 496 488 static unsigned int ··· 500 492 unsigned int wsize; 501 493 502 494 /* start with specified wsize, or default */ 503 - wsize = ctx->wsize ? ctx->wsize : SMB3_DEFAULT_IOSIZE; 495 + wsize = ctx->got_wsize ? ctx->vol_wsize : SMB3_DEFAULT_IOSIZE; 504 496 wsize = min_t(unsigned int, wsize, server->max_write); 505 497 #ifdef CONFIG_CIFS_SMB_DIRECT 506 498 if (server->rdma) { ··· 522 514 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) 523 515 wsize = min_t(unsigned int, wsize, SMB2_MAX_BUFFER_SIZE); 524 516 525 - return wsize; 517 + return prevent_zero_iosize(wsize, "w"); 526 518 } 527 519 528 520 static unsigned int ··· 532 524 unsigned int rsize; 533 525 534 526 /* start with specified rsize, or default */ 535 - rsize = ctx->rsize ? ctx->rsize : CIFS_DEFAULT_IOSIZE; 527 + rsize = ctx->got_rsize ? ctx->vol_rsize : CIFS_DEFAULT_IOSIZE; 536 528 rsize = min_t(unsigned int, rsize, server->max_read); 537 529 538 530 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) 539 531 rsize = min_t(unsigned int, rsize, SMB2_MAX_BUFFER_SIZE); 540 532 541 - return rsize; 533 + return prevent_zero_iosize(rsize, "r"); 542 534 } 543 535 544 536 static unsigned int ··· 548 540 unsigned int rsize; 549 541 550 542 /* start with specified rsize, or default */ 551 - rsize = ctx->rsize ? ctx->rsize : SMB3_DEFAULT_IOSIZE; 543 + rsize = ctx->got_rsize ? ctx->vol_rsize : SMB3_DEFAULT_IOSIZE; 552 544 rsize = min_t(unsigned int, rsize, server->max_read); 553 545 #ifdef CONFIG_CIFS_SMB_DIRECT 554 546 if (server->rdma) { ··· 571 563 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) 572 564 rsize = min_t(unsigned int, rsize, SMB2_MAX_BUFFER_SIZE); 573 565 574 - return rsize; 566 + return prevent_zero_iosize(rsize, "r"); 575 567 } 576 568 577 569 /* ··· 3534 3526 if (rc == 0) { 3535 3527 netfs_resize_file(&cifsi->netfs, new_eof, true); 3536 3528 cifs_setsize(inode, new_eof); 3537 - cifs_truncate_page(inode->i_mapping, inode->i_size); 3538 - truncate_setsize(inode, new_eof); 3539 3529 } 3540 3530 goto out; 3541 3531 }
+22 -2
fs/smb/client/smb2pdu.c
··· 43 43 #endif 44 44 #include "cached_dir.h" 45 45 #include "compress.h" 46 + #include "fs_context.h" 46 47 47 48 /* 48 49 * The following table defines the expected "StructureSize" of SMB2 requests ··· 4090 4089 add_credits(server, &credits, CIFS_ECHO_OP); 4091 4090 } 4092 4091 4092 + static void cifs_renegotiate_iosize(struct TCP_Server_Info *server, 4093 + struct cifs_tcon *tcon) 4094 + { 4095 + struct cifs_sb_info *cifs_sb; 4096 + 4097 + if (server == NULL || tcon == NULL) 4098 + return; 4099 + 4100 + spin_lock(&tcon->sb_list_lock); 4101 + list_for_each_entry(cifs_sb, &tcon->cifs_sb_list, tcon_sb_link) { 4102 + cifs_sb->ctx->rsize = 4103 + server->ops->negotiate_rsize(tcon, cifs_sb->ctx); 4104 + cifs_sb->ctx->wsize = 4105 + server->ops->negotiate_wsize(tcon, cifs_sb->ctx); 4106 + } 4107 + spin_unlock(&tcon->sb_list_lock); 4108 + } 4109 + 4093 4110 void smb2_reconnect_server(struct work_struct *work) 4094 4111 { 4095 4112 struct TCP_Server_Info *server = container_of(work, ··· 4193 4174 4194 4175 list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) { 4195 4176 rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon, server, true); 4196 - if (!rc) 4177 + if (!rc) { 4178 + cifs_renegotiate_iosize(server, tcon); 4197 4179 cifs_reopen_persistent_handles(tcon); 4198 - else 4180 + } else 4199 4181 resched = true; 4200 4182 list_del_init(&tcon->rlist); 4201 4183 if (tcon->ipc)
+3
fs/smb/client/transport.c
··· 894 894 case MID_SHUTDOWN: 895 895 rc = -EHOSTDOWN; 896 896 break; 897 + case MID_RC: 898 + rc = mid->mid_rc; 899 + break; 897 900 default: 898 901 if (!(mid->mid_flags & MID_DELETED)) { 899 902 list_del_init(&mid->qhead);
+36
fs/smb/client/xattr.c
··· 31 31 * secure, replaced by SMB2 (then even more highly secure SMB3) many years ago 32 32 */ 33 33 #define SMB3_XATTR_CIFS_ACL "system.smb3_acl" /* DACL only */ 34 + #define SMB3_XATTR_CIFS_NTSD_SACL "system.smb3_ntsd_sacl" /* SACL only */ 35 + #define SMB3_XATTR_CIFS_NTSD_OWNER "system.smb3_ntsd_owner" /* owner only */ 34 36 #define SMB3_XATTR_CIFS_NTSD "system.smb3_ntsd" /* owner plus DACL */ 35 37 #define SMB3_XATTR_CIFS_NTSD_FULL "system.smb3_ntsd_full" /* owner/DACL/SACL */ 36 38 #define SMB3_XATTR_ATTRIB "smb3.dosattrib" /* full name: user.smb3.dosattrib */ ··· 40 38 /* BB need to add server (Samba e.g) support for security and trusted prefix */ 41 39 42 40 enum { XATTR_USER, XATTR_CIFS_ACL, XATTR_ACL_ACCESS, XATTR_ACL_DEFAULT, 41 + XATTR_CIFS_NTSD_SACL, XATTR_CIFS_NTSD_OWNER, 43 42 XATTR_CIFS_NTSD, XATTR_CIFS_NTSD_FULL }; 44 43 45 44 static int cifs_attrib_set(unsigned int xid, struct cifs_tcon *pTcon, ··· 163 160 break; 164 161 165 162 case XATTR_CIFS_ACL: 163 + case XATTR_CIFS_NTSD_SACL: 164 + case XATTR_CIFS_NTSD_OWNER: 166 165 case XATTR_CIFS_NTSD: 167 166 case XATTR_CIFS_NTSD_FULL: { 168 167 struct smb_ntsd *pacl; ··· 191 186 aclflags = (CIFS_ACL_OWNER | 192 187 CIFS_ACL_GROUP | 193 188 CIFS_ACL_DACL); 189 + break; 190 + case XATTR_CIFS_NTSD_OWNER: 191 + aclflags = (CIFS_ACL_OWNER | 192 + CIFS_ACL_GROUP); 193 + break; 194 + case XATTR_CIFS_NTSD_SACL: 195 + aclflags = CIFS_ACL_SACL; 194 196 break; 195 197 case XATTR_CIFS_ACL: 196 198 default: ··· 320 308 break; 321 309 322 310 case XATTR_CIFS_ACL: 311 + case XATTR_CIFS_NTSD_SACL: 312 + case XATTR_CIFS_NTSD_OWNER: 323 313 case XATTR_CIFS_NTSD: 324 314 case XATTR_CIFS_NTSD_FULL: { 325 315 /* ··· 340 326 break; 341 327 case XATTR_CIFS_NTSD: 342 328 extra_info = OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO; 329 + break; 330 + case XATTR_CIFS_NTSD_OWNER: 331 + extra_info = OWNER_SECINFO | GROUP_SECINFO; 332 + break; 333 + case XATTR_CIFS_NTSD_SACL: 334 + extra_info = SACL_SECINFO; 343 335 break; 344 336 case XATTR_CIFS_ACL: 345 337 default: ··· 468 448 .set = cifs_xattr_set, 469 449 }; 470 450 451 + static const struct xattr_handler smb3_ntsd_sacl_xattr_handler = { 452 + .name = SMB3_XATTR_CIFS_NTSD_SACL, 453 + .flags = XATTR_CIFS_NTSD_SACL, 454 + .get = cifs_xattr_get, 455 + .set = cifs_xattr_set, 456 + }; 457 + 458 + static const struct xattr_handler smb3_ntsd_owner_xattr_handler = { 459 + .name = SMB3_XATTR_CIFS_NTSD_OWNER, 460 + .flags = XATTR_CIFS_NTSD_OWNER, 461 + .get = cifs_xattr_get, 462 + .set = cifs_xattr_set, 463 + }; 464 + 471 465 static const struct xattr_handler cifs_cifs_ntsd_xattr_handler = { 472 466 .name = CIFS_XATTR_CIFS_NTSD, 473 467 .flags = XATTR_CIFS_NTSD, ··· 527 493 &cifs_os2_xattr_handler, 528 494 &cifs_cifs_acl_xattr_handler, 529 495 &smb3_acl_xattr_handler, /* alias for above since avoiding "cifs" */ 496 + &smb3_ntsd_sacl_xattr_handler, 497 + &smb3_ntsd_owner_xattr_handler, 530 498 &cifs_cifs_ntsd_xattr_handler, 531 499 &smb3_ntsd_xattr_handler, /* alias for above since avoiding "cifs" */ 532 500 &cifs_cifs_ntsd_full_xattr_handler,
+3
fs/smb/common/smb2pdu.h
··· 95 95 */ 96 96 #define SMB3_DEFAULT_IOSIZE (4 * 1024 * 1024) 97 97 98 + /* According to MS-SMB2 specification The minimum recommended value is 65536.*/ 99 + #define CIFS_MIN_DEFAULT_IOSIZE (65536) 100 + 98 101 /* 99 102 * SMB2 Header Definition 100 103 *