* [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)
@ 2026-07-14 7:16 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-07-13 22:05 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [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)
@ 2026-07-14 7:16 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2026-07-14 7:16 UTC (permalink / raw)
To: oe-kbuild, Amir Goldstein; +Cc: lkp, oe-kbuild-all
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [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)
2026-07-14 7:16 ` Dan Carpenter
(?)
@ 2026-07-14 11:06 ` Amir Goldstein
-1 siblings, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2026-07-14 11:06 UTC (permalink / raw)
To: Dan Carpenter; +Cc: oe-kbuild, lkp, oe-kbuild-all, Christian Brauner
On Tue, Jul 14, 2026 at 9:16 AM Dan Carpenter <error27@gmail.com> wrote:
>
> 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)
I think this assumption was wrong and the extra f_out->f_op test can
be avoided here
>
> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-14 11:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 22:05 [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) kernel test robot
2026-07-14 7:16 ` Dan Carpenter
2026-07-14 11:06 ` Amir Goldstein
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.