From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [amir73il:ovl_copy_file_range 3/6] fs/read_write.c:1499 copy_file_fs_cmp() error: we previously assumed 'f_out->f_op' could be null (see line 1496)
Date: Tue, 14 Jul 2026 06:05:01 +0800 [thread overview]
Message-ID: <202607140512.I7Hcmuea-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Amir Goldstein <amir73il@gmail.com>
tree: https://github.com/amir73il/linux ovl_copy_file_range
head: 4421f88f42bb20b8a6f9fd56c5c877a1088d0e00
commit: b86e287575a3f81b04ef92b5bb46f87329fc314f [3/6] fs: add support for copy file range from another fs
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: i386-randconfig-141-20260714 (https://download.01.org/0day-ci/archive/20260714/202607140512.I7Hcmuea-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c
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/202607140512.I7Hcmuea-lkp@intel.com/
New smatch warnings:
fs/read_write.c:1499 copy_file_fs_cmp() error: we previously assumed 'f_out->f_op' could be null (see line 1496)
Old smatch warnings:
fs/read_write.c:1631 vfs_copy_file_range() error: we previously assumed 'file_out->f_op->copy_file_range' could be null (see line 1614)
vim +1499 fs/read_write.c
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1482
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1483 /*
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1484 * Check if src and dst file are on the same filesystem.
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1485 * nfs and cifs define several different file_system_type structures
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1486 * and several different sets of file_operations, but they all end up
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1487 * using the same ->copy_file_range() function pointer.
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1488 * COPY_FILE_SPLICE is an opt-in flag for cross-fs copy (e.g. from nfsd),
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1489 * so do not compare src<->dst filesystems in this case.
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1490 */
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1491 static int copy_file_fs_cmp(struct file *f_in, struct file *f_out,
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1492 unsigned int flags)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1493 {
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1494 if (flags & COPY_FILE_SPLICE)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1495 return FS_COPY_SPLICE;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 @1496 else if (f_out->f_op && f_out->f_op->copy_file_range &&
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1497 f_out->f_op->copy_file_range == f_in->f_op->copy_file_range)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1498 return FS_COPY_SAME_FS;
b86e287575a3f8 Amir Goldstein 2026-07-13 @1499 else if (f_out->f_op->fop_flags & FOP_CROSS_FS_COPY)
b86e287575a3f8 Amir Goldstein 2026-07-13 1500 return FS_COPY_FROM_OTHER_FS;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1501 else if (file_inode(f_in)->i_sb == file_inode(f_out)->i_sb)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1502 return FS_COPY_SAME_SB;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1503 else
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1504 return FS_COPY_CROSS_FS;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1505 }
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1506
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Amir Goldstein <amir73il@gmail.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: [amir73il:ovl_copy_file_range 3/6] fs/read_write.c:1499 copy_file_fs_cmp() error: we previously assumed 'f_out->f_op' could be null (see line 1496)
Date: Tue, 14 Jul 2026 10:16:46 +0300 [thread overview]
Message-ID: <202607140512.I7Hcmuea-lkp@intel.com> (raw)
tree: https://github.com/amir73il/linux ovl_copy_file_range
head: 4421f88f42bb20b8a6f9fd56c5c877a1088d0e00
commit: b86e287575a3f81b04ef92b5bb46f87329fc314f [3/6] fs: add support for copy file range from another fs
config: i386-randconfig-141-20260714 (https://download.01.org/0day-ci/archive/20260714/202607140512.I7Hcmuea-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c
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/202607140512.I7Hcmuea-lkp@intel.com/
New smatch warnings:
fs/read_write.c:1499 copy_file_fs_cmp() error: we previously assumed 'f_out->f_op' could be null (see line 1496)
Old smatch warnings:
fs/read_write.c:1631 vfs_copy_file_range() error: we previously assumed 'file_out->f_op->copy_file_range' could be null (see line 1614)
vim +1499 fs/read_write.c
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1491 static int copy_file_fs_cmp(struct file *f_in, struct file *f_out,
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1492 unsigned int flags)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1493 {
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1494 if (flags & COPY_FILE_SPLICE)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1495 return FS_COPY_SPLICE;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 @1496 else if (f_out->f_op && f_out->f_op->copy_file_range &&
^^^^^^^^^^^
if ->f_op is NULL
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1497 f_out->f_op->copy_file_range == f_in->f_op->copy_file_range)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1498 return FS_COPY_SAME_FS;
b86e287575a3f8 Amir Goldstein 2026-07-13 @1499 else if (f_out->f_op->fop_flags & FOP_CROSS_FS_COPY)
^^^^^^^^^^^^^^^^^^^^^^
then we are toasted.
b86e287575a3f8 Amir Goldstein 2026-07-13 1500 return FS_COPY_FROM_OTHER_FS;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1501 else if (file_inode(f_in)->i_sb == file_inode(f_out)->i_sb)
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1502 return FS_COPY_SAME_SB;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1503 else
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1504 return FS_COPY_CROSS_FS;
cd6e8d0dbe33ef Amir Goldstein 2026-07-13 1505 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-07-13 22:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 22:05 kernel test robot [this message]
2026-07-14 7:16 ` [amir73il:ovl_copy_file_range 3/6] fs/read_write.c:1499 copy_file_fs_cmp() error: we previously assumed 'f_out->f_op' could be null (see line 1496) Dan Carpenter
2026-07-14 11:06 ` Amir Goldstein
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=202607140512.I7Hcmuea-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@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.