All of lore.kernel.org
 help / color / mirror / Atom feed
From: He Zhe <zhe.he@windriver.com>
To: dchinner@redhat.com, amir73il@gmail.com,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Cc: He Zhe <Zhe.He@windriver.com>
Subject: warning for EOPNOTSUPP vfs_copy_file_range
Date: Thu, 19 May 2022 16:22:04 +0800	[thread overview]
Message-ID: <20f17f64-88cb-4e80-07c1-85cb96c83619@windriver.com> (raw)

Hi,

We are experiencing the following warning from
"WARN_ON_ONCE(ret == -EOPNOTSUPP);" in vfs_copy_file_range, from
64bf5ff58dff ("vfs: no fallback for ->copy_file_range")

# cat /sys/class/net/can0/phys_switch_id

WARNING: CPU: 7 PID: 673 at fs/read_write.c:1516 vfs_copy_file_range+0x380/0x440
Modules linked in: llce_can llce_logger llce_mailbox llce_core sch_fq_codel
openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4
CPU: 7 PID: 673 Comm: cat Not tainted 5.15.38-yocto-standard #1
Hardware name: Freescale S32G399A (DT)
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : vfs_copy_file_range+0x380/0x440
lr : vfs_copy_file_range+0x16c/0x440
sp : ffffffc00e0f3ce0
x29: ffffffc00e0f3ce0 x28: ffffff88157b5a40 x27: 0000000000000000
x26: ffffff8816ac3230 x25: ffffff881c060008 x24: 0000000000001000
x23: 0000000000000000 x22: 0000000000000000 x21: ffffff881cc99540
x20: ffffff881cc9a340 x19: ffffffffffffffa1 x18: ffffffffffffffff
x17: 0000000000000001 x16: 0000adfbb5178cde x15: ffffffc08e0f3647
x14: 0000000000000000 x13: 34613178302f3061 x12: 3178302b636e7973
x11: 0000000000058395 x10: 00000000fd1c5755 x9 : ffffffc008361950
x8 : ffffffc00a7d4d58 x7 : 0000000000000000 x6 : 0000000000000001
x5 : ffffffc009e81000 x4 : ffffffc009e817f8 x3 : 0000000000000000
x2 : 0000000000000000 x1 : ffffff88157b5a40 x0 : ffffffffffffffa1
Call trace:
 vfs_copy_file_range+0x380/0x440
 __do_sys_copy_file_range+0x178/0x3a4
 __arm64_sys_copy_file_range+0x34/0x4c
 invoke_syscall+0x5c/0x130
 el0_svc_common.constprop.0+0x68/0x124
 do_el0_svc+0x50/0xbc
 el0_svc+0x54/0x130
 el0t_64_sync_handler+0xa4/0x130
 el0t_64_sync+0x1a0/0x1a4
cat: /sys/class/net/can0/phys_switch_id: Operation not supported

And we found this is triggered by the following stack. Specifically, all
netdev_ops in CAN drivers we can find now do not have ndo_get_port_parent_id and
ndo_get_devlink_port, which makes phys_switch_id_show return -EOPNOTSUPP all the
way back to vfs_copy_file_range.

phys_switch_id_show+0xf4/0x11c
dev_attr_show+0x2c/0x6c
sysfs_kf_seq_show+0xb8/0x150
kernfs_seq_show+0x38/0x44
seq_read_iter+0x1c4/0x4c0
kernfs_fop_read_iter+0x44/0x50
generic_file_splice_read+0xdc/0x190
do_splice_to+0xa0/0xfc
splice_direct_to_actor+0xc4/0x250
do_splice_direct+0x94/0xe0
vfs_copy_file_range+0x16c/0x440
__do_sys_copy_file_range+0x178/0x3a4
__arm64_sys_copy_file_range+0x34/0x4c
invoke_syscall+0x5c/0x130
el0_svc_common.constprop.0+0x68/0x124
do_el0_svc+0x50/0xbc
el0_svc+0x54/0x130
el0t_64_sync_handler+0xa4/0x130
el0t_64_sync+0x1a0/0x1a4

According to the original commit log, this warning is for operational validity
checks to generic_copy_file_range(). The reading will eventually return as
not supported as printed above. But is this warning still necessary? If so we
might want to remove it to have a cleaner dmesg.


Thanks,
Zhe

             reply	other threads:[~2022-05-19  8:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  8:22 He Zhe [this message]
2022-05-19 13:53 ` warning for EOPNOTSUPP vfs_copy_file_range Amir Goldstein
2022-05-19 14:31   ` Luís Henriques
2022-05-20  3:03     ` He Zhe
2022-05-20  4:42       ` Amir Goldstein
2022-05-20  3:16     ` Paul Gortmaker
2022-05-20  3:56   ` Al Viro
2022-05-20  4:39     ` Amir Goldstein
2022-05-20  7:52       ` 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=20f17f64-88cb-4e80-07c1-85cb96c83619@windriver.com \
    --to=zhe.he@windriver.com \
    --cc=amir73il@gmail.com \
    --cc=dchinner@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.