From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3863011754569272988==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [smfrench-smb3:for-next 6/6] fs/cifs/sess.c:129 cifs_try_adding_channels() warn: inconsistent indenting Date: Wed, 16 Feb 2022 17:27:57 +0800 Message-ID: <202202161725.7B3m2CWC-lkp@intel.com> List-Id: --===============3863011754569272988== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: git://github.com/smfrench/smb3-kernel.git for-next head: 5279203f772d0e52e17e13bef6b8ea81720caf1d commit: 5279203f772d0e52e17e13bef6b8ea81720caf1d [6/6] cifs: use a differen= t reconnect helper for non-cifsd threads config: x86_64-randconfig-m001-20220214 (https://download.01.org/0day-ci/ar= chive/20220216/202202161725.7B3m2CWC-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot smatch warnings: fs/cifs/sess.c:129 cifs_try_adding_channels() warn: inconsistent indenting vim +129 fs/cifs/sess.c 118 = 119 /* returns number of channels added */ 120 int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct ci= fs_ses *ses) 121 { 122 int old_chan_count, new_chan_count; 123 int left; 124 int i =3D 0; 125 int rc =3D 0; 126 int tries =3D 0; 127 struct cifs_server_iface *ifaces =3D NULL; 128 size_t iface_count; > 129 dump_stack(); 130 if (ses->server->dialect < SMB30_PROT_ID) { 131 cifs_dbg(VFS, "multichannel is not supported on this protocol vers= ion, use 3.0 or above\n"); 132 return 0; 133 } 134 = 135 spin_lock(&ses->chan_lock); 136 = 137 new_chan_count =3D old_chan_count =3D ses->chan_count; 138 left =3D ses->chan_max - ses->chan_count; 139 = 140 if (left <=3D 0) { 141 spin_unlock(&ses->chan_lock); 142 cifs_dbg(VFS, 143 "ses already at max_channels (%zu), nothing to open. chan_max %z= u\n", 144 ses->chan_max, ses->chan_count); 145 return 0; 146 } 147 = 148 if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { 149 ses->chan_max =3D 1; 150 spin_unlock(&ses->chan_lock); 151 cifs_dbg(VFS, "server %s does not support multichannel\n", ses->se= rver->hostname); 152 return 0; 153 } 154 spin_unlock(&ses->chan_lock); 155 = 156 /* 157 * Make a copy of the iface list at the time and use that 158 * instead so as to not hold the iface spinlock for opening 159 * channels 160 */ 161 spin_lock(&ses->iface_lock); 162 iface_count =3D ses->iface_count; 163 if (iface_count <=3D 0) { 164 spin_unlock(&ses->iface_lock); 165 cifs_dbg(VFS, "no iface list available to open channels\n"); 166 return 0; 167 } 168 ifaces =3D kmemdup(ses->iface_list, iface_count*sizeof(*ifaces), 169 GFP_ATOMIC); 170 if (!ifaces) { 171 spin_unlock(&ses->iface_lock); 172 return 0; 173 } 174 spin_unlock(&ses->iface_lock); 175 = 176 /* 177 * Keep connecting to same, fastest, iface for all channels as 178 * long as its RSS. Try next fastest one if not RSS or channel 179 * creation fails. 180 */ 181 while (left > 0) { 182 struct cifs_server_iface *iface; 183 = 184 tries++; 185 if (tries > 3*ses->chan_max) { 186 cifs_dbg(FYI, "too many channel open attempts (%d channels left t= o open)\n", 187 left); 188 break; 189 } 190 = 191 iface =3D &ifaces[i]; 192 if (is_ses_using_iface(ses, iface) && !iface->rss_capable) { 193 i =3D (i+1) % iface_count; 194 continue; 195 } 196 = 197 rc =3D cifs_ses_add_channel(cifs_sb, ses, iface); 198 if (rc) { 199 cifs_dbg(FYI, "failed to open extra channel on iface#%d rc=3D%d\n= ", 200 i, rc); 201 i =3D (i+1) % iface_count; 202 continue; 203 } 204 = 205 cifs_dbg(FYI, "successfully opened new channel on iface#%d\n", 206 i); 207 left--; 208 new_chan_count++; 209 } 210 = 211 kfree(ifaces); 212 return new_chan_count - old_chan_count; 213 } 214 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============3863011754569272988==--