diff options
author | Steve French <smfrench@gmail.com> | 2015-06-24 00:37:11 -0400 |
---|---|---|
committer | Steve French <steve.french@primarydata.com> | 2015-06-27 23:28:11 -0400 |
commit | aab1893d5fbeb7c931e97189f54a71ab0ecbf4c7 (patch) | |
tree | 3ee55544c479e51524fefb8ecfe049f86e2758ef /fs/cifs | |
parent | 80bc83c360ef04cd1f5f8f0fb9c47669e702c980 (diff) |
Add SMB3.11 mount option synonym for new dialect
Most people think of SMB 3.1.1 as SMB version 3.11 so add synonym
for "vers=3.1.1" of "vers=3.11" on mount.
Also make sure that unlike SMB3.0 and 3.02 we don't send
validate negotiate on mount (it is handled by negotiate contexts) -
add list of SMB3.11 specific functions (distinct from 3.0 dialect).
Signed-off-by: Steve French <steve.french@primarydata.com>w
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsglob.h | 3 | ||||
-rw-r--r-- | fs/cifs/connect.c | 3 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 86 |
3 files changed, 90 insertions, 2 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 71bf86e6de9a..a0212ec6f701 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -1622,6 +1622,7 @@ extern struct smb_version_values smb30_values; | |||
1622 | /*extern struct smb_version_operations smb302_operations;*/ /* not needed yet */ | 1622 | /*extern struct smb_version_operations smb302_operations;*/ /* not needed yet */ |
1623 | extern struct smb_version_values smb302_values; | 1623 | extern struct smb_version_values smb302_values; |
1624 | #define SMB311_VERSION_STRING "3.1.1" | 1624 | #define SMB311_VERSION_STRING "3.1.1" |
1625 | /*extern struct smb_version_operations smb311_operations;*/ /* not needed yet */ | 1625 | #define ALT_SMB311_VERSION_STRING "3.11" |
1626 | extern struct smb_version_operations smb311_operations; | ||
1626 | extern struct smb_version_values smb311_values; | 1627 | extern struct smb_version_values smb311_values; |
1627 | #endif /* _CIFS_GLOB_H */ | 1628 | #endif /* _CIFS_GLOB_H */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 9300b98d8584..247f4dd228cc 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -282,6 +282,7 @@ static const match_table_t cifs_smb_version_tokens = { | |||
282 | { Smb_302, SMB302_VERSION_STRING }, | 282 | { Smb_302, SMB302_VERSION_STRING }, |
283 | #ifdef CONFIG_CIFS_SMB311 | 283 | #ifdef CONFIG_CIFS_SMB311 |
284 | { Smb_311, SMB311_VERSION_STRING }, | 284 | { Smb_311, SMB311_VERSION_STRING }, |
285 | { Smb_311, ALT_SMB311_VERSION_STRING }, | ||
285 | #endif /* SMB311 */ | 286 | #endif /* SMB311 */ |
286 | { Smb_version_err, NULL } | 287 | { Smb_version_err, NULL } |
287 | }; | 288 | }; |
@@ -1139,7 +1140,7 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol) | |||
1139 | break; | 1140 | break; |
1140 | #ifdef CONFIG_CIFS_SMB311 | 1141 | #ifdef CONFIG_CIFS_SMB311 |
1141 | case Smb_311: | 1142 | case Smb_311: |
1142 | vol->ops = &smb30_operations; /* currently identical with 3.0 */ | 1143 | vol->ops = &smb311_operations; |
1143 | vol->vals = &smb311_values; | 1144 | vol->vals = &smb311_values; |
1144 | break; | 1145 | break; |
1145 | #endif /* SMB311 */ | 1146 | #endif /* SMB311 */ |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index a7d520cc2cfd..c7d228c4006a 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -1635,6 +1635,92 @@ struct smb_version_operations smb30_operations = { | |||
1635 | .fallocate = smb3_fallocate, | 1635 | .fallocate = smb3_fallocate, |
1636 | }; | 1636 | }; |
1637 | 1637 | ||
1638 | #ifdef CONFIG_CIFS_SMB311 | ||
1639 | struct smb_version_operations smb311_operations = { | ||
1640 | .compare_fids = smb2_compare_fids, | ||
1641 | .setup_request = smb2_setup_request, | ||
1642 | .setup_async_request = smb2_setup_async_request, | ||
1643 | .check_receive = smb2_check_receive, | ||
1644 | .add_credits = smb2_add_credits, | ||
1645 | .set_credits = smb2_set_credits, | ||
1646 | .get_credits_field = smb2_get_credits_field, | ||
1647 | .get_credits = smb2_get_credits, | ||
1648 | .wait_mtu_credits = smb2_wait_mtu_credits, | ||
1649 | .get_next_mid = smb2_get_next_mid, | ||
1650 | .read_data_offset = smb2_read_data_offset, | ||
1651 | .read_data_length = smb2_read_data_length, | ||
1652 | .map_error = map_smb2_to_linux_error, | ||
1653 | .find_mid = smb2_find_mid, | ||
1654 | .check_message = smb2_check_message, | ||
1655 | .dump_detail = smb2_dump_detail, | ||
1656 | .clear_stats = smb2_clear_stats, | ||
1657 | .print_stats = smb2_print_stats, | ||
1658 | .dump_share_caps = smb2_dump_share_caps, | ||
1659 | .is_oplock_break = smb2_is_valid_oplock_break, | ||
1660 | .downgrade_oplock = smb2_downgrade_oplock, | ||
1661 | .need_neg = smb2_need_neg, | ||
1662 | .negotiate = smb2_negotiate, | ||
1663 | .negotiate_wsize = smb2_negotiate_wsize, | ||
1664 | .negotiate_rsize = smb2_negotiate_rsize, | ||
1665 | .sess_setup = SMB2_sess_setup, | ||
1666 | .logoff = SMB2_logoff, | ||
1667 | .tree_connect = SMB2_tcon, | ||
1668 | .tree_disconnect = SMB2_tdis, | ||
1669 | .qfs_tcon = smb3_qfs_tcon, | ||
1670 | .is_path_accessible = smb2_is_path_accessible, | ||
1671 | .can_echo = smb2_can_echo, | ||
1672 | .echo = SMB2_echo, | ||
1673 | .query_path_info = smb2_query_path_info, | ||
1674 | .get_srv_inum = smb2_get_srv_inum, | ||
1675 | .query_file_info = smb2_query_file_info, | ||
1676 | .set_path_size = smb2_set_path_size, | ||
1677 | .set_file_size = smb2_set_file_size, | ||
1678 | .set_file_info = smb2_set_file_info, | ||
1679 | .set_compression = smb2_set_compression, | ||
1680 | .mkdir = smb2_mkdir, | ||
1681 | .mkdir_setinfo = smb2_mkdir_setinfo, | ||
1682 | .rmdir = smb2_rmdir, | ||
1683 | .unlink = smb2_unlink, | ||
1684 | .rename = smb2_rename_path, | ||
1685 | .create_hardlink = smb2_create_hardlink, | ||
1686 | .query_symlink = smb2_query_symlink, | ||
1687 | .query_mf_symlink = smb3_query_mf_symlink, | ||
1688 | .create_mf_symlink = smb3_create_mf_symlink, | ||
1689 | .open = smb2_open_file, | ||
1690 | .set_fid = smb2_set_fid, | ||
1691 | .close = smb2_close_file, | ||
1692 | .flush = smb2_flush_file, | ||
1693 | .async_readv = smb2_async_readv, | ||
1694 | .async_writev = smb2_async_writev, | ||
1695 | .sync_read = smb2_sync_read, | ||
1696 | .sync_write = smb2_sync_write, | ||
1697 | .query_dir_first = smb2_query_dir_first, | ||
1698 | .query_dir_next = smb2_query_dir_next, | ||
1699 | .close_dir = smb2_close_dir, | ||
1700 | .calc_smb_size = smb2_calc_size, | ||
1701 | .is_status_pending = smb2_is_status_pending, | ||
1702 | .oplock_response = smb2_oplock_response, | ||
1703 | .queryfs = smb2_queryfs, | ||
1704 | .mand_lock = smb2_mand_lock, | ||
1705 | .mand_unlock_range = smb2_unlock_range, | ||
1706 | .push_mand_locks = smb2_push_mandatory_locks, | ||
1707 | .get_lease_key = smb2_get_lease_key, | ||
1708 | .set_lease_key = smb2_set_lease_key, | ||
1709 | .new_lease_key = smb2_new_lease_key, | ||
1710 | .generate_signingkey = generate_smb3signingkey, | ||
1711 | .calc_signature = smb3_calc_signature, | ||
1712 | .is_read_op = smb21_is_read_op, | ||
1713 | .set_oplock_level = smb3_set_oplock_level, | ||
1714 | .create_lease_buf = smb3_create_lease_buf, | ||
1715 | .parse_lease_buf = smb3_parse_lease_buf, | ||
1716 | .clone_range = smb2_clone_range, | ||
1717 | /* .validate_negotiate = smb3_validate_negotiate, */ /* not used in 3.11 */ | ||
1718 | .wp_retry_size = smb2_wp_retry_size, | ||
1719 | .dir_needs_close = smb2_dir_needs_close, | ||
1720 | .fallocate = smb3_fallocate, | ||
1721 | }; | ||
1722 | #endif /* CIFS_SMB311 */ | ||
1723 | |||
1638 | struct smb_version_values smb20_values = { | 1724 | struct smb_version_values smb20_values = { |
1639 | .version_string = SMB20_VERSION_STRING, | 1725 | .version_string = SMB20_VERSION_STRING, |
1640 | .protocol_id = SMB20_PROT_ID, | 1726 | .protocol_id = SMB20_PROT_ID, |