* [smfrench-smb3:pr/146 1/1] fs/smb/client/link.c:509 cifs_hardlink() error: we previously assumed 'old_file' could be null (see line 464)
@ 2026-03-30 19:59 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-03-30 15:32 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Steve French <stfrench@microsoft.com>
tree: https://github.com/smfrench/smb3-kernel.git pr/146
head: d290e116f12405d8269c6041cbf68bc924b4cba6
commit: d290e116f12405d8269c6041cbf68bc924b4cba6 [1/1] smb: client: add support for O_TMPFILE (WIP)
:::::: branch date: 23 hours ago
:::::: commit date: 23 hours ago
config: x86_64-randconfig-161-20260330 (https://download.01.org/0day-ci/archive/20260330/202603302356.u8QdlRIM-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9004-gb810ac53
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202603302356.u8QdlRIM-lkp@intel.com/
smatch warnings:
fs/smb/client/link.c:509 cifs_hardlink() error: we previously assumed 'old_file' could be null (see line 464)
vim +/old_file +509 fs/smb/client/link.c
5ab97578cbb3bf fs/cifs/link.c Steve French 2014-09-15 435
0f8dce1cb7454f fs/cifs/link.c Sachin Prabhu 2013-11-25 436 /*
0f8dce1cb7454f fs/cifs/link.c Sachin Prabhu 2013-11-25 437 * M-F Symlink Functions - End
0f8dce1cb7454f fs/cifs/link.c Sachin Prabhu 2013-11-25 438 */
8bfb50a882ccd9 fs/cifs/link.c Stefan Metzmacher 2010-07-31 439
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 440 int
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 441 cifs_hardlink(struct dentry *old_file, struct inode *inode,
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 442 struct dentry *direntry)
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 443 {
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 444 int rc = -EACCES;
6d5786a34d98bf fs/cifs/link.c Pavel Shilovsky 2012-06-20 445 unsigned int xid;
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 446 const char *from_name, *to_name;
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 447 void *page1 = NULL, *page2 = NULL;
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 448 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 449 struct tcon_link *tlink;
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 450 struct cifs_tcon *tcon;
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 451 struct TCP_Server_Info *server;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 452 struct cifsInodeInfo *cifsInode;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 453
087f757b012985 fs/cifs/link.c Steve French 2021-04-29 454 if (unlikely(cifs_forced_shutdown(cifs_sb)))
f80ac7eda1cf52 fs/smb/client/link.c David Howells 2025-10-24 455 return smb_EIO(smb_eio_trace_forced_shutdown);
087f757b012985 fs/cifs/link.c Steve French 2021-04-29 456
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 457 tlink = cifs_sb_tlink(cifs_sb);
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 458 if (IS_ERR(tlink))
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 459 return PTR_ERR(tlink);
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 460 tcon = tlink_tcon(tlink);
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 461
6d5786a34d98bf fs/cifs/link.c Pavel Shilovsky 2012-06-20 462 xid = get_xid();
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 463
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 @464 if (old_file && d_really_is_positive(old_file) &&
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 465 test_bit(CIFS_INO_TMPFILE, &CIFS_I(d_inode(old_file))->flags)) {
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 466 from_name = NULL;
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 467 } else {
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 468 page1 = alloc_dentry_path();
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 469 from_name = build_path_from_dentry(old_file, page1);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 470 if (IS_ERR(from_name)) {
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 471 rc = PTR_ERR(from_name);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 472 goto cifs_hl_exit;
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 473 }
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 474 }
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 475
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 476 page2 = alloc_dentry_path();
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 477 to_name = build_path_from_dentry(direntry, page2);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 478 if (IS_ERR(to_name)) {
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 479 rc = PTR_ERR(to_name);
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 480 goto cifs_hl_exit;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 481 }
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 482
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 483 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 484 if (tcon->unix_ext)
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 485 rc = CIFSUnixCreateHardLink(xid, tcon, from_name, to_name,
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 486 cifs_sb->local_nls,
2baa2682531ff0 fs/cifs/link.c Steve French 2014-09-27 487 cifs_remap(cifs_sb));
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 488 else {
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 489 #else
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 490 {
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 491 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 492 server = tcon->ses->server;
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 493 if (!server->ops->create_hardlink) {
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 494 rc = -ENOSYS;
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 495 goto cifs_hl_exit;
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 496 }
5408990aa662bc fs/smb/client/link.c Paulo Alcantara 2023-11-25 497 rc = server->ops->create_hardlink(xid, tcon, old_file,
5408990aa662bc fs/smb/client/link.c Paulo Alcantara 2023-11-25 498 from_name, to_name, cifs_sb);
083d3a2cff514c fs/cifs/link.c Steve French 2006-03-03 499 if ((rc == -EIO) || (rc == -EINVAL))
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 500 rc = -EOPNOTSUPP;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 501 }
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 502
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 503 d_drop(direntry); /* force new lookup from server of target */
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 504
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 505 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 506 * if source file is cached (oplocked) revalidate will not go to server
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 507 * until the file is closed or oplock broken so update nlinks locally
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 508 */
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 @509 if (d_really_is_positive(old_file)) {
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 510 cifsInode = CIFS_I(d_inode(old_file));
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 511 if (rc == 0) {
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 512 clear_bit(CIFS_INO_TMPFILE, &cifsInode->flags);
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 513 spin_lock(&d_inode(old_file)->i_lock);
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 514 inc_nlink(d_inode(old_file));
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 515 spin_unlock(&d_inode(old_file)->i_lock);
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 516
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 517 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 518 * parent dir timestamps will update from srv within a
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 519 * second, would it really be worth it to set the parent
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 520 * dir cifs inode time to zero to force revalidate
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 521 * (faster) for it too?
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 522 */
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 523 }
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 524 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 525 * if not oplocked will force revalidate to get info on source
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 526 * file from srv. Note Samba server prior to 4.2 has bug -
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 527 * not updating src file ctime on hardlinks but Windows servers
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 528 * handle it properly
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 529 */
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 530 cifsInode->time = 0;
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 531
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 532 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 533 * Will update parent dir timestamps from srv within a second.
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 534 * Would it really be worth it to set the parent dir (cifs
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 535 * inode) time field to zero to force revalidate on parent
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 536 * directory faster ie
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 537 *
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 538 * CIFS_I(inode)->time = 0;
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 539 */
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 540 }
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 541
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 542 cifs_hl_exit:
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 543 free_dentry_path(page1);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 544 free_dentry_path(page2);
6d5786a34d98bf fs/cifs/link.c Pavel Shilovsky 2012-06-20 545 free_xid(xid);
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 546 cifs_put_tlink(tlink);
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 547 return rc;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 548 }
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 549
:::::: The code at line 509 was first introduced by commit
:::::: 2b0143b5c986be1ce8408b3aadc4709e0a94429d VFS: normal filesystems (and lustre): d_inode() annotations
:::::: TO: David Howells <dhowells@redhat.com>
:::::: CC: Al Viro <viro@zeniv.linux.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* [smfrench-smb3:pr/146 1/1] fs/smb/client/link.c:509 cifs_hardlink() error: we previously assumed 'old_file' could be null (see line 464)
@ 2026-03-30 19:59 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-03-30 19:59 UTC (permalink / raw)
To: oe-kbuild, Steve French; +Cc: lkp, oe-kbuild-all
tree: https://github.com/smfrench/smb3-kernel.git pr/146
head: d290e116f12405d8269c6041cbf68bc924b4cba6
commit: d290e116f12405d8269c6041cbf68bc924b4cba6 [1/1] smb: client: add support for O_TMPFILE (WIP)
config: x86_64-randconfig-161-20260330 (https://download.01.org/0day-ci/archive/20260330/202603302356.u8QdlRIM-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9004-gb810ac53
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202603302356.u8QdlRIM-lkp@intel.com/
smatch warnings:
fs/smb/client/link.c:509 cifs_hardlink() error: we previously assumed 'old_file' could be null (see line 464)
vim +/old_file +509 fs/smb/client/link.c
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 440 int
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 441 cifs_hardlink(struct dentry *old_file, struct inode *inode,
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 442 struct dentry *direntry)
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 443 {
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 444 int rc = -EACCES;
6d5786a34d98bf fs/cifs/link.c Pavel Shilovsky 2012-06-20 445 unsigned int xid;
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 446 const char *from_name, *to_name;
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 447 void *page1 = NULL, *page2 = NULL;
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 448 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 449 struct tcon_link *tlink;
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 450 struct cifs_tcon *tcon;
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 451 struct TCP_Server_Info *server;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 452 struct cifsInodeInfo *cifsInode;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 453
087f757b012985 fs/cifs/link.c Steve French 2021-04-29 454 if (unlikely(cifs_forced_shutdown(cifs_sb)))
f80ac7eda1cf52 fs/smb/client/link.c David Howells 2025-10-24 455 return smb_EIO(smb_eio_trace_forced_shutdown);
087f757b012985 fs/cifs/link.c Steve French 2021-04-29 456
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 457 tlink = cifs_sb_tlink(cifs_sb);
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 458 if (IS_ERR(tlink))
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 459 return PTR_ERR(tlink);
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 460 tcon = tlink_tcon(tlink);
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 461
6d5786a34d98bf fs/cifs/link.c Pavel Shilovsky 2012-06-20 462 xid = get_xid();
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 463
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 @464 if (old_file && d_really_is_positive(old_file) &&
^^^^^^^^
If old_file is NULL
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 465 test_bit(CIFS_INO_TMPFILE, &CIFS_I(d_inode(old_file))->flags)) {
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 466 from_name = NULL;
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 467 } else {
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 468 page1 = alloc_dentry_path();
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 469 from_name = build_path_from_dentry(old_file, page1);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 470 if (IS_ERR(from_name)) {
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 471 rc = PTR_ERR(from_name);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 472 goto cifs_hl_exit;
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 473 }
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 474 }
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 475
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 476 page2 = alloc_dentry_path();
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 477 to_name = build_path_from_dentry(direntry, page2);
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 478 if (IS_ERR(to_name)) {
f6a9bc336b600e fs/cifs/link.c Al Viro 2021-03-05 479 rc = PTR_ERR(to_name);
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 480 goto cifs_hl_exit;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 481 }
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 482
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 483 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 484 if (tcon->unix_ext)
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 485 rc = CIFSUnixCreateHardLink(xid, tcon, from_name, to_name,
7ffec372458d16 fs/cifs/link.c Jeff Layton 2010-09-29 486 cifs_sb->local_nls,
2baa2682531ff0 fs/cifs/link.c Steve French 2014-09-27 487 cifs_remap(cifs_sb));
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 488 else {
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 489 #else
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 490 {
fb157ed226d225 fs/cifs/link.c Steve French 2022-08-01 491 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 492 server = tcon->ses->server;
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 493 if (!server->ops->create_hardlink) {
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 494 rc = -ENOSYS;
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 495 goto cifs_hl_exit;
abf9767c823bf5 fs/cifs/link.c Christian Engelmayer 2014-01-11 496 }
5408990aa662bc fs/smb/client/link.c Paulo Alcantara 2023-11-25 497 rc = server->ops->create_hardlink(xid, tcon, old_file,
5408990aa662bc fs/smb/client/link.c Paulo Alcantara 2023-11-25 498 from_name, to_name, cifs_sb);
083d3a2cff514c fs/cifs/link.c Steve French 2006-03-03 499 if ((rc == -EIO) || (rc == -EINVAL))
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 500 rc = -EOPNOTSUPP;
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 501 }
^1da177e4c3f41 fs/cifs/link.c Linus Torvalds 2005-04-16 502
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 503 d_drop(direntry); /* force new lookup from server of target */
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 504
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 505 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 506 * if source file is cached (oplocked) revalidate will not go to server
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 507 * until the file is closed or oplock broken so update nlinks locally
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 508 */
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 @509 if (d_really_is_positive(old_file)) {
^^^^^^^^
Then we are toasted here. Unchecked dereference.
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 510 cifsInode = CIFS_I(d_inode(old_file));
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 511 if (rc == 0) {
d290e116f12405 fs/smb/client/link.c Paulo Alcantara 2026-03-27 512 clear_bit(CIFS_INO_TMPFILE, &cifsInode->flags);
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 513 spin_lock(&d_inode(old_file)->i_lock);
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 514 inc_nlink(d_inode(old_file));
2b0143b5c986be fs/cifs/link.c David Howells 2015-03-17 515 spin_unlock(&d_inode(old_file)->i_lock);
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 516
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 517 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 518 * parent dir timestamps will update from srv within a
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 519 * second, would it really be worth it to set the parent
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 520 * dir cifs inode time to zero to force revalidate
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 521 * (faster) for it too?
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 522 */
31ec35d6c81175 fs/cifs/link.c Steve French 2006-11-16 523 }
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 524 /*
d6e906f1b571d1 fs/cifs/link.c Steve French 2012-09-18 525 * if not oplocked will force revalidate to get info on source
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 526 * file from srv. Note Samba server prior to 4.2 has bug -
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 527 * not updating src file ctime on hardlinks but Windows servers
ff273cb879fbc6 fs/cifs/link.c Steve French 2014-10-17 528 * handle it properly
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-30 19:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 15:32 [smfrench-smb3:pr/146 1/1] fs/smb/client/link.c:509 cifs_hardlink() error: we previously assumed 'old_file' could be null (see line 464) kernel test robot
2026-03-30 19:59 ` Dan Carpenter
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.