* [smfrench-smb3:for-next 6/6] fs/cifs/sess.c:129 cifs_try_adding_channels() warn: inconsistent indenting
@ 2022-02-16 9:27 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-16 9:27 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3924 bytes --]
tree: git://github.com/smfrench/smb3-kernel.git for-next
head: 5279203f772d0e52e17e13bef6b8ea81720caf1d
commit: 5279203f772d0e52e17e13bef6b8ea81720caf1d [6/6] cifs: use a different reconnect helper for non-cifsd threads
config: x86_64-randconfig-m001-20220214 (https://download.01.org/0day-ci/archive/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 <lkp@intel.com>
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 cifs_ses *ses)
121 {
122 int old_chan_count, new_chan_count;
123 int left;
124 int i = 0;
125 int rc = 0;
126 int tries = 0;
127 struct cifs_server_iface *ifaces = 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 version, use 3.0 or above\n");
132 return 0;
133 }
134
135 spin_lock(&ses->chan_lock);
136
137 new_chan_count = old_chan_count = ses->chan_count;
138 left = ses->chan_max - ses->chan_count;
139
140 if (left <= 0) {
141 spin_unlock(&ses->chan_lock);
142 cifs_dbg(VFS,
143 "ses already at max_channels (%zu), nothing to open. chan_max %zu\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 = 1;
150 spin_unlock(&ses->chan_lock);
151 cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->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 = ses->iface_count;
163 if (iface_count <= 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 = 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 to open)\n",
187 left);
188 break;
189 }
190
191 iface = &ifaces[i];
192 if (is_ses_using_iface(ses, iface) && !iface->rss_capable) {
193 i = (i+1) % iface_count;
194 continue;
195 }
196
197 rc = cifs_ses_add_channel(cifs_sb, ses, iface);
198 if (rc) {
199 cifs_dbg(FYI, "failed to open extra channel on iface#%d rc=%d\n",
200 i, rc);
201 i = (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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-16 9:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-16 9:27 [smfrench-smb3:for-next 6/6] fs/cifs/sess.c:129 cifs_try_adding_channels() warn: inconsistent indenting kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.