From: kernel test robot <lkp@intel.com>
To: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev,
Christian Brauner <christianvanbrauner@gmail.com>,
Christian Brauner <brauner@kernel.org>,
Jeff Layton <jlayton@kernel.org>,
Aleksa Sarai <aleksa@amutable.com>
Subject: fs/smb/client/dir.c:248:10: error: use of undeclared label 'out'
Date: Sat, 02 May 2026 01:27:11 +0800 [thread overview]
Message-ID: <202605020138.EI8o7MFz-lkp@intel.com> (raw)
tree: https://github.com/brauner/linux.git vfs-7.2.openat.regular
head: be7728badbd230f1ee7beba4162383fa022ae767
commit: 93306cec35846eebf467d63a775fa711d7106b2e openat2: new OPENAT2_REGULAR flag support
date: 2 weeks ago
config: i386-randconfig-141-20260501 (https://download.01.org/0day-ci/archive/20260502/202605020138.EI8o7MFz-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9065-ge9cc34fd
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260502/202605020138.EI8o7MFz-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605020138.EI8o7MFz-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/smb/client/dir.c:248:10: error: use of undeclared label 'out'
248 | goto out;
| ^
1 error generated.
vim +/out +248 fs/smb/client/dir.c
199
200 /* Inode operations in similar order to how they appear in Linux file fs.h */
201 static int __cifs_do_create(struct inode *dir, struct dentry *direntry,
202 const char *full_path, unsigned int xid,
203 struct tcon_link *tlink, unsigned int oflags,
204 umode_t mode, __u32 *oplock, struct cifs_fid *fid,
205 struct cifs_open_info_data *buf,
206 struct inode **inode)
207 {
208 int rc = -ENOENT;
209 int create_options = CREATE_NOT_DIR;
210 int desired_access;
211 struct cifs_sb_info *cifs_sb = CIFS_SB(dir);
212 struct cifs_tcon *tcon = tlink_tcon(tlink);
213 struct inode *newinode = NULL;
214 unsigned int sbflags = cifs_sb_flags(cifs_sb);
215 int disposition;
216 struct TCP_Server_Info *server = tcon->ses->server;
217 struct cifs_open_parms oparms;
218 struct cached_fid *parent_cfid = NULL;
219 int rdwr_for_fscache = 0;
220 __le32 lease_flags = 0;
221
222 *inode = NULL;
223 *oplock = 0;
224 if (tcon->ses->server->oplocks)
225 *oplock = REQ_OPLOCK;
226
227 /* If we're caching, we need to be able to fill in around partial writes. */
228 if (cifs_fscache_enabled(dir) && (oflags & O_ACCMODE) == O_WRONLY)
229 rdwr_for_fscache = 1;
230
231 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
232 if (tcon->unix_ext && cap_unix(tcon->ses) && !tcon->broken_posix_open &&
233 (CIFS_UNIX_POSIX_PATH_OPS_CAP &
234 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
235 rc = cifs_posix_open(full_path, &newinode, dir->i_sb, mode,
236 oflags, oplock, &fid->netfid, xid);
237 switch (rc) {
238 case 0:
239 if (newinode == NULL) {
240 /* query inode info */
241 goto cifs_create_get_file_info;
242 }
243
244 if ((oflags & OPENAT2_REGULAR) && !S_ISREG(newinode->i_mode)) {
245 CIFSSMBClose(xid, tcon, fid->netfid);
246 iput(newinode);
247 rc = -EFTYPE;
> 248 goto out;
249 }
250
251 if (S_ISDIR(newinode->i_mode)) {
252 CIFSSMBClose(xid, tcon, fid->netfid);
253 iput(newinode);
254 return -EISDIR;
255 }
256
257 if (!S_ISREG(newinode->i_mode)) {
258 /*
259 * The server may allow us to open things like
260 * FIFOs, but the client isn't set up to deal
261 * with that. If it's not a regular file, just
262 * close it and proceed as if it were a normal
263 * lookup.
264 */
265 CIFSSMBClose(xid, tcon, fid->netfid);
266 goto cifs_create_get_file_info;
267 }
268 /* success, no need to query */
269 goto cifs_create_set_dentry;
270
271 case -ENOENT:
272 goto cifs_create_get_file_info;
273
274 case -EIO:
275 case -EINVAL:
276 /*
277 * EIO could indicate that (posix open) operation is not
278 * supported, despite what server claimed in capability
279 * negotiation.
280 *
281 * POSIX open in samba versions 3.3.1 and earlier could
282 * incorrectly fail with invalid parameter.
283 */
284 tcon->broken_posix_open = true;
285 break;
286
287 case -EREMOTE:
288 case -EOPNOTSUPP:
289 /*
290 * EREMOTE indicates DFS junction, which is not handled
291 * in posix open. If either that or op not supported
292 * returned, follow the normal lookup.
293 */
294 break;
295
296 default:
297 return rc;
298 }
299 /*
300 * fallthrough to retry, using older open call, this is case
301 * where server does not support this SMB level, and falsely
302 * claims capability (also get here for DFS case which should be
303 * rare for path not covered on files)
304 */
305 }
306 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
307
308 desired_access = 0;
309 if (OPEN_FMODE(oflags) & FMODE_READ)
310 desired_access |= GENERIC_READ; /* is this too little? */
311 if (OPEN_FMODE(oflags) & FMODE_WRITE)
312 desired_access |= GENERIC_WRITE;
313 if (rdwr_for_fscache == 1)
314 desired_access |= GENERIC_READ;
315 if (oflags & O_TMPFILE)
316 desired_access |= DELETE;
317
318 disposition = FILE_OVERWRITE_IF;
319 if (oflags & O_CREAT) {
320 if (oflags & O_EXCL)
321 disposition = FILE_CREATE;
322 else if (oflags & O_TRUNC)
323 disposition = FILE_OVERWRITE_IF;
324 else
325 disposition = FILE_OPEN_IF;
326 } else if (oflags & O_TMPFILE) {
327 disposition = FILE_CREATE;
328 } else {
329 cifs_dbg(FYI, "Create flag not set in create function\n");
330 }
331
332 /*
333 * BB add processing to set equivalent of mode - e.g. via CreateX with
334 * ACLs
335 */
336
337 if (!server->ops->open)
338 return -EOPNOTSUPP;
339
340 create_options |= cifs_open_create_options(oflags, create_options);
341 /*
342 * if we're not using unix extensions, see if we need to set
343 * ATTR_READONLY on the create call
344 */
345 if (!tcon->unix_ext && (mode & S_IWUGO) == 0)
346 create_options |= CREATE_OPTION_READONLY;
347
348
349 retry_open:
350 if (tcon->cfids && direntry->d_parent && server->dialect >= SMB30_PROT_ID) {
351 parent_cfid = NULL;
352 spin_lock(&tcon->cfids->cfid_list_lock);
353 list_for_each_entry(parent_cfid, &tcon->cfids->entries, entry) {
354 if (parent_cfid->dentry == direntry->d_parent) {
355 cifs_dbg(FYI, "found a parent cached file handle\n");
356 if (is_valid_cached_dir(parent_cfid)) {
357 lease_flags
358 |= SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET_LE;
359 memcpy(fid->parent_lease_key,
360 parent_cfid->fid.lease_key,
361 SMB2_LEASE_KEY_SIZE);
362 parent_cfid->dirents.is_valid = false;
363 parent_cfid->dirents.is_failed = true;
364 }
365 break;
366 }
367 }
368 spin_unlock(&tcon->cfids->cfid_list_lock);
369 }
370
371 oparms = (struct cifs_open_parms) {
372 .tcon = tcon,
373 .cifs_sb = cifs_sb,
374 .desired_access = desired_access,
375 .create_options = cifs_create_options(cifs_sb, create_options),
376 .disposition = disposition,
377 .path = full_path,
378 .fid = fid,
379 .lease_flags = lease_flags,
380 .mode = mode,
381 };
382 rc = server->ops->open(xid, &oparms, oplock, buf);
383 if (rc) {
384 cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
385 if (rc == -EACCES && rdwr_for_fscache == 1) {
386 desired_access &= ~GENERIC_READ;
387 rdwr_for_fscache = 2;
388 goto retry_open;
389 }
390 return rc;
391 }
392 if (rdwr_for_fscache == 2)
393 cifs_invalidate_cache(dir, FSCACHE_INVAL_DIO_WRITE);
394
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-05-01 17:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 17:27 kernel test robot [this message]
2026-05-11 10:07 ` fs/smb/client/dir.c:248:10: error: use of undeclared label 'out' Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202605020138.EI8o7MFz-lkp@intel.com \
--to=lkp@intel.com \
--cc=aleksa@amutable.com \
--cc=brauner@kernel.org \
--cc=christianvanbrauner@gmail.com \
--cc=dorjoychy111@gmail.com \
--cc=jlayton@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.