tree: git://git.samba.org/sfrench/cifs-2.6.git for-next head: ab82f67684b914bf4843f3ea34aa7032be53f66e commit: ab82f67684b914bf4843f3ea34aa7032be53f66e [26/26] smb3: Add posix create context on open for smb3.11 posix mounts config: i386-randconfig-x016-201821 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: git checkout ab82f67684b914bf4843f3ea34aa7032be53f66e # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:10:0, from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/wait_bit.h:8, from include/linux/fs.h:6, from fs/cifs/connect.c:21: fs/cifs/connect.c: In function 'cifs_mount': fs/cifs/connect.c:3967:10: error: 'struct cifs_tcon' has no member named 'posix_extensions' if (tcon->posix_extensions) ^ include/linux/compiler.h:58:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ >> fs/cifs/connect.c:3967:2: note: in expansion of macro 'if' if (tcon->posix_extensions) ^~ fs/cifs/connect.c:3967:10: error: 'struct cifs_tcon' has no member named 'posix_extensions' if (tcon->posix_extensions) ^ include/linux/compiler.h:58:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ >> fs/cifs/connect.c:3967:2: note: in expansion of macro 'if' if (tcon->posix_extensions) ^~ fs/cifs/connect.c:3967:10: error: 'struct cifs_tcon' has no member named 'posix_extensions' if (tcon->posix_extensions) ^ include/linux/compiler.h:69:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^~~~ >> fs/cifs/connect.c:3967:2: note: in expansion of macro 'if' if (tcon->posix_extensions) ^~ fs/cifs/connect.c: In function 'cifs_construct_tcon': fs/cifs/connect.c:4432:10: error: 'struct cifs_tcon' has no member named 'posix_extensions' if (tcon->posix_extensions) ^ include/linux/compiler.h:58:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ fs/cifs/connect.c:4432:2: note: in expansion of macro 'if' if (tcon->posix_extensions) ^~ fs/cifs/connect.c:4432:10: error: 'struct cifs_tcon' has no member named 'posix_extensions' if (tcon->posix_extensions) ^ include/linux/compiler.h:58:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ fs/cifs/connect.c:4432:2: note: in expansion of macro 'if' if (tcon->posix_extensions) ^~ fs/cifs/connect.c:4432:10: error: 'struct cifs_tcon' has no member named 'posix_extensions' if (tcon->posix_extensions) ^ include/linux/compiler.h:69:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^~~~ fs/cifs/connect.c:4432:2: note: in expansion of macro 'if' if (tcon->posix_extensions) ^~ vim +/if +3967 fs/cifs/connect.c 3905 3906 #ifdef CONFIG_CIFS_DFS_UPCALL 3907 try_mount_again: 3908 /* cleanup activities if we're chasing a referral */ 3909 if (referral_walks_count) { 3910 if (tcon) 3911 cifs_put_tcon(tcon); 3912 else if (ses) 3913 cifs_put_smb_ses(ses); 3914 3915 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_POSIX_PATHS; 3916 3917 free_xid(xid); 3918 } 3919 #endif 3920 rc = 0; 3921 tcon = NULL; 3922 ses = NULL; 3923 server = NULL; 3924 full_path = NULL; 3925 tlink = NULL; 3926 3927 xid = get_xid(); 3928 3929 /* get a reference to a tcp session */ 3930 server = cifs_get_tcp_session(volume_info); 3931 if (IS_ERR(server)) { 3932 rc = PTR_ERR(server); 3933 goto out; 3934 } 3935 if ((volume_info->max_credits < 20) || 3936 (volume_info->max_credits > 60000)) 3937 server->max_credits = SMB2_MAX_CREDITS_AVAILABLE; 3938 else 3939 server->max_credits = volume_info->max_credits; 3940 /* get a reference to a SMB session */ 3941 ses = cifs_get_smb_ses(server, volume_info); 3942 if (IS_ERR(ses)) { 3943 rc = PTR_ERR(ses); 3944 ses = NULL; 3945 goto mount_fail_check; 3946 } 3947 3948 if ((volume_info->persistent == true) && ((ses->server->capabilities & 3949 SMB2_GLOBAL_CAP_PERSISTENT_HANDLES) == 0)) { 3950 cifs_dbg(VFS, "persistent handles not supported by server\n"); 3951 rc = -EOPNOTSUPP; 3952 goto mount_fail_check; 3953 } 3954 3955 /* search for existing tcon to this server share */ 3956 tcon = cifs_get_tcon(ses, volume_info); 3957 if (IS_ERR(tcon)) { 3958 rc = PTR_ERR(tcon); 3959 tcon = NULL; 3960 if (rc == -EACCES) 3961 goto mount_fail_check; 3962 3963 goto remote_path_check; 3964 } 3965 3966 /* if new SMB3.11 POSIX extensions are supported do not remap / and \ */ > 3967 if (tcon->posix_extensions) 3968 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; 3969 3970 /* tell server which Unix caps we support */ 3971 if (cap_unix(tcon->ses)) { 3972 /* reset of caps checks mount to see if unix extensions 3973 disabled for just this mount */ 3974 reset_cifs_unix_caps(xid, tcon, cifs_sb, volume_info); 3975 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && 3976 (le64_to_cpu(tcon->fsUnixInfo.Capability) & 3977 CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)) { 3978 rc = -EACCES; 3979 goto mount_fail_check; 3980 } 3981 } else 3982 tcon->unix_ext = 0; /* server does not support them */ 3983 3984 /* do not care if a following call succeed - informational */ 3985 if (!tcon->pipe && server->ops->qfs_tcon) 3986 server->ops->qfs_tcon(xid, tcon); 3987 3988 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, volume_info); 3989 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, volume_info); 3990 3991 remote_path_check: 3992 #ifdef CONFIG_CIFS_DFS_UPCALL 3993 /* 3994 * Perform an unconditional check for whether there are DFS 3995 * referrals for this path without prefix, to provide support 3996 * for DFS referrals from w2k8 servers which don't seem to respond 3997 * with PATH_NOT_COVERED to requests that include the prefix. 3998 * Chase the referral if found, otherwise continue normally. 3999 */ 4000 if (referral_walks_count == 0) { 4001 int refrc = expand_dfs_referral(xid, ses, volume_info, cifs_sb, 4002 false); 4003 if (!refrc) { 4004 referral_walks_count++; 4005 goto try_mount_again; 4006 } 4007 } 4008 #endif 4009 4010 /* check if a whole path is not remote */ 4011 if (!rc && tcon) { 4012 if (!server->ops->is_path_accessible) { 4013 rc = -ENOSYS; 4014 goto mount_fail_check; 4015 } 4016 /* 4017 * cifs_build_path_to_root works only when we have a valid tcon 4018 */ 4019 full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon, 4020 tcon->Flags & SMB_SHARE_IS_IN_DFS); 4021 if (full_path == NULL) { 4022 rc = -ENOMEM; 4023 goto mount_fail_check; 4024 } 4025 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, 4026 full_path); 4027 if (rc != 0 && rc != -EREMOTE) { 4028 kfree(full_path); 4029 goto mount_fail_check; 4030 } 4031 4032 if (rc != -EREMOTE) { 4033 rc = cifs_are_all_path_components_accessible(server, 4034 xid, tcon, cifs_sb, 4035 full_path); 4036 if (rc != 0) { 4037 cifs_dbg(VFS, "cannot query dirs between root and final path, " 4038 "enabling CIFS_MOUNT_USE_PREFIX_PATH\n"); 4039 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; 4040 rc = 0; 4041 } 4042 } 4043 kfree(full_path); 4044 } 4045 4046 /* get referral if needed */ 4047 if (rc == -EREMOTE) { 4048 #ifdef CONFIG_CIFS_DFS_UPCALL 4049 if (referral_walks_count > MAX_NESTED_LINKS) { 4050 /* 4051 * BB: when we implement proper loop detection, 4052 * we will remove this check. But now we need it 4053 * to prevent an indefinite loop if 'DFS tree' is 4054 * misconfigured (i.e. has loops). 4055 */ 4056 rc = -ELOOP; 4057 goto mount_fail_check; 4058 } 4059 4060 rc = expand_dfs_referral(xid, ses, volume_info, cifs_sb, true); 4061 4062 if (!rc) { 4063 referral_walks_count++; 4064 goto try_mount_again; 4065 } 4066 goto mount_fail_check; 4067 #else /* No DFS support, return error on mount */ 4068 rc = -EOPNOTSUPP; 4069 #endif 4070 } 4071 4072 if (rc) 4073 goto mount_fail_check; 4074 4075 /* now, hang the tcon off of the superblock */ 4076 tlink = kzalloc(sizeof *tlink, GFP_KERNEL); 4077 if (tlink == NULL) { 4078 rc = -ENOMEM; 4079 goto mount_fail_check; 4080 } 4081 4082 tlink->tl_uid = ses->linux_uid; 4083 tlink->tl_tcon = tcon; 4084 tlink->tl_time = jiffies; 4085 set_bit(TCON_LINK_MASTER, &tlink->tl_flags); 4086 set_bit(TCON_LINK_IN_TREE, &tlink->tl_flags); 4087 4088 cifs_sb->master_tlink = tlink; 4089 spin_lock(&cifs_sb->tlink_tree_lock); 4090 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); 4091 spin_unlock(&cifs_sb->tlink_tree_lock); 4092 4093 queue_delayed_work(cifsiod_wq, &cifs_sb->prune_tlinks, 4094 TLINK_IDLE_EXPIRE); 4095 4096 mount_fail_check: 4097 /* on error free sesinfo and tcon struct if needed */ 4098 if (rc) { 4099 /* If find_unc succeeded then rc == 0 so we can not end */ 4100 /* up accidentally freeing someone elses tcon struct */ 4101 if (tcon) 4102 cifs_put_tcon(tcon); 4103 else if (ses) 4104 cifs_put_smb_ses(ses); 4105 else 4106 cifs_put_tcp_session(server, 0); 4107 } 4108 4109 out: 4110 free_xid(xid); 4111 return rc; 4112 } 4113 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip