[PATCH v4] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-22 Thread Su Yanjun
The sizeof(u32) is hardcoded. It's better to use the config value in regmap. It increases the size of target object, but it's flexible when new mcp chip need other val_bytes. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 9 ++--- 1 file changed, 6 insertions

[PATCH v1] can: mcp251xfd: Add some sysfs debug interfaces for registers r/w

2021-01-21 Thread Su Yanjun
When i debug mcp2518fd, some method to track registers is needed. This easy debug interface will be ok. For example, read a register at 0xe00: echo 0xe00 > can_get_reg cat can_get_reg write a register at 0xe00: echo 0xe00,0x60 > can_set_reg Signed-off-by: Su Yanjun --- .../net/c

[PATCH v3] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-21 Thread Su Yanjun
The sizeof(u32) is hardcoded. It's better to use the config value in regmap. It increases the size of target object, but it's flexible when new mcp chip need other val_bytes. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 9 ++--- 1 file changed, 6 insertions

[PATCH v1] can: mcp251xfd: use regmap_bulk_write for compatibility

2021-01-21 Thread Su Yanjun
Recently i use mcp2518fd on 4.x kernel which multiple write is not backported, regmap_raw_write will cause old kernel crash because the tx buffer in driver is smaller then 2K. Use regmap_bulk_write instead for compatibility. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd

[PATCH v2] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-21 Thread Su Yanjun
No functional effect. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index

[PATCH v1] can: mcp251xfd: replace sizeof(u32) with val_bytes in regmap

2021-01-21 Thread Su Yanjun
No functional effect. Signed-off-by: Su Yanjun --- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index

About patch NFS: Fix O_DIRECT accounting of number of bytes read/written

2019-10-15 Thread Su, Yanjun
Hi trond, Because My mail system cant receive nfs mail list’s mails, I reply your patch here. I have some question for the patch. >No. Basic O_DIRECT does not guarantee atomicity of requests, which is >why we do not have generic locking at the VFS level when reading and >writing. The only

Re: [PATCH] NFS: Fix O_DIRECT read problem when another write is going on

2019-10-06 Thread Su Yanjun
在 2019/10/1 2:06, Trond Myklebust 写道: Hi Su, On Mon, 2019-09-30 at 17:11 +0800, Su Yanjun wrote: In xfstests generic/465 tests failed. Because O_DIRECT r/w use async rpc calls, when r/w rpc calls are running concurrently we may read partial data which is wrong. For example as follows

[PATCH] NFS: Fix O_DIRECT read problem when another write is going on

2019-09-30 Thread Su Yanjun
as if read nothing. When the reader issue another read it will read ok. Signed-off-by: Su Yanjun --- fs/nfs/direct.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 222d711..7f737a3 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs

[PATCH net] ipv4: fix ifa_flags reuse problem in using ifconfig tool

2019-09-04 Thread Su Yanjun
especially some old scripts or program [2] still use ifconfig. [1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/ commit/fec80e7473ad16979af75ed299d68103e7aa3fe9 [2] LTP or TAHI Signed-off-by: Su Yanjun --- net/ipv4/devinet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4

[tip:perf/urgent] perf/x86: Fix typo in comment

2019-08-19 Thread tip-bot for Su Yanjun
Commit-ID: 77d760328ee015cf89460c52bfd5a6b0a09b7472 Gitweb: https://git.kernel.org/tip/77d760328ee015cf89460c52bfd5a6b0a09b7472 Author: Su Yanjun AuthorDate: Fri, 16 Aug 2019 16:43:21 +0800 Committer: Ingo Molnar CommitDate: Mon, 19 Aug 2019 11:50:24 +0200 perf/x86: Fix typo

[PATCH] perf/x86: Fix typo in core.c

2019-08-16 Thread Su Yanjun
No functional change related. Signed-off-by: Su Yanjun --- arch/x86/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 81b005e..325959d 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c

[PATCH net v3] net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-30 Thread Su Yanjun
laced in the IP Source Address of the outgoing solicitation. Otherwise, any one of the addresses assigned to the interface should be used." In this patch we try get a global address if we get ll address failed. Signed-off-by: Su Yanjun --- Changes since V2: - Let banned_flags under the sc

[PATCH net v2] net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-29 Thread Su Yanjun
laced in the IP Source Address of the outgoing solicitation. Otherwise, any one of the addresses assigned to the interface should be used." In this patch we try get a global address if we get ll address failed. Signed-off-by: Su Yanjun --- Changes since V1: - Change patch descriptio

[PATCH net] net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-28 Thread Su Yanjun
d in the IP Source Address of the outgoing solicitation. Otherwise, any one of the addresses assigned to the interface should be used." In this patch we try get a global address if we get ll address failed. Signed-off-by: Su Yanjun --- include/net/addrconf.h | 4 ++

[PATCH] udp: Fix typo in net/ipv4/udp.c

2019-07-17 Thread Su Yanjun
Signed-off-by: Su Yanjun --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index c21862b..d88821c 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2170,7 +2170,7 @@ static int __udp4_lib_mcast_deliver(struct net *net

[PATCH] udp: Fix typo in udpv4/p.c

2019-07-17 Thread Su Yanjun
Signed-off-by: Su Yanjun --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index c21862b..d88821c 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2170,7 +2170,7 @@ static int __udp4_lib_mcast_deliver(struct net *net

Re: [Problem]testOpenUpgradeLock test failed in nfsv4.0 in 5.2.0-rc7

2019-07-07 Thread Su Yanjun
Ang ping? 在 2019/7/3 9:34, Su Yanjun 写道: Hi Frank We tested the pynfs of NFSv4.0 on the latest version of the kernel (5.2.0-rc7). I encountered a problem while testing st_lock.testOpenUpgradeLock. The problem is now as follows: ** LOCK24

[Problem]testOpenUpgradeLock test failed in nfsv4.0 in 5.2.0-rc7

2019-07-02 Thread Su Yanjun
Hi Frank We tested the pynfs of NFSv4.0 on the latest version of the kernel (5.2.0-rc7). I encountered a problem while testing st_lock.testOpenUpgradeLock. The problem is now as follows: ** LOCK24 st_lock.testOpenUpgradeLock : FAILURE    

Re: [PATCH] sctp: Add rcu lock to protect dst entry in sctp_transport_route

2019-06-13 Thread Su Yanjun
在 2019/6/12 21:13, Neil Horman 写道: On Tue, Jun 11, 2019 at 10:33:17AM +0800, Su Yanjun wrote: 在 2019/6/10 19:12, Neil Horman 写道: On Mon, Jun 10, 2019 at 11:20:00AM +0800, Su Yanjun wrote: syzbot found a crash in rt_cache_valid. Problem is that when more threads release dst

[PATCH] sctp: Add rcu lock to protect dst entry in sctp_transport_route

2019-06-09 Thread Su Yanjun
will cause dst->refcnt==0 then rcu softirq will reclaim the dst entry,get_dst then use the freed memory. This patch adds rcu lock to protect the dst_entry here. Fixes: 6e91b578bf3f("sctp: re-use sctp_transport_pmtu in sctp_transport_route") Signed-off-by: Su Yanjun Report

[PATCH v3] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm

2019-03-06 Thread Su Yanjun
introduce a new wrapper function of nlmsg_unicast to handle type conversions. This patch also fixes a direct access of a rcu protected socket. Fixes: be33690d8fcf("[XFRM]: Fix aevent related crash") Signed-off-by: Su Yanjun --- Changes from v2: - add 'Fixes' tag and some description

Re: [PATCH] net: xfrm: Fix potential oops in xfrm_user_rcv_msg and array out of bounds

2019-03-04 Thread Su Yanjun
On 2019/3/5 15:31, Steffen Klassert wrote: On Tue, Mar 05, 2019 at 03:08:49PM +0800, Su Yanjun wrote: On 2019/3/5 14:49, Herbert Xu wrote: On Sun, Mar 03, 2019 at 10:47:39PM -0500, Su Yanjun wrote: When i review xfrm_user.c code, i found some potentical bug in it. In xfrm_user_rcvmsg

[PATCH v2] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm

2019-03-04 Thread Su Yanjun
introduce a new wrapper function of nlmsg_unicast to handle type conversions. No functional change. Signed-off-by: Su Yanjun --- Changes from v1: - fix spelling mistakes and the sparse tool' warnings include/net/netns/xfrm.h | 2 +- net/xfrm/xfrm_user.c | 30

[PATCH] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm

2019-03-03 Thread Su Yanjun
For rcu protected pointers, we'd bettter add '__rcu' for them. No functional change. Signed-off-by: Su Yanjun --- include/net/netns/xfrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 59f45b1..d2a36fb 100644

[PATCH] net: xfrm: Fix potential oops in xfrm_user_rcv_msg and array out of bounds

2019-03-03 Thread Su Yanjun
When i review xfrm_user.c code, i found some potentical bug in it. In xfrm_user_rcvmsg if type parameter from user space is set to XFRM_MSG_MAX or XFRM_MSG_NEWSADINFO or XFRM_MSG_NEWSPDINFO. It will cause xfrm_user_rcv_msg referring to null entry in xfrm_dispatch array. Signed-off-by: Su

Re: [PATCH] netfilter: nf_ct_helper: Fix possible panic when nf_conntrack_helper_unregister is used in an unloadable module

2019-03-01 Thread Su Yanjun
On 2019/3/1 16:43, Sergei Shtylyov wrote: Hello! On 01.03.2019 8:56, Su Yanjun wrote: From: Su Yanjun Because nf_conntrack_helper_unregister maybe used in an unloadable module, it uses 'synchronize_rcu' which may cause kernel panic. According to the artical:    Article? I got

[PATCH] netfilter: nf_ct_helper: Fix possible panic when nf_conntrack_helper_unregister is used in an unloadable module

2019-02-28 Thread Su Yanjun
From: Su Yanjun Because nf_conntrack_helper_unregister maybe used in an unloadable module, it uses 'synchronize_rcu' which may cause kernel panic. According to the artical: RCU and Unloadable Modules https://lwn.net/Articles/217484/ When we have a heavy rcu callback load, then some

Re: [PATCH] xfs: correct statx's result_mask value

2019-01-07 Thread Su Yanjun
On 1/8/2019 1:07 PM, Darrick J. Wong wrote: On Tue, Jan 08, 2019 at 12:58:43PM +0800, Su Yanjun wrote: On 1/8/2019 2:04 AM, Eric Sandeen wrote: On 1/7/19 11:52 AM, Darrick J. Wong wrote: On Mon, Jan 07, 2019 at 04:53:10AM -0500, Su Yanjun wrote: For statx syscall, xfs return the wrong

Re: [PATCH] xfs: correct statx's result_mask value

2019-01-07 Thread Su Yanjun
On 1/8/2019 2:04 AM, Eric Sandeen wrote: On 1/7/19 11:52 AM, Darrick J. Wong wrote: On Mon, Jan 07, 2019 at 04:53:10AM -0500, Su Yanjun wrote: For statx syscall, xfs return the wrong result_mask. Signed-off-by: Su Yanjun --- fs/xfs/xfs_iops.c | 3 +++ 1 file changed, 3 insertions

[PATCH] xfs: correct statx's result_mask value

2019-01-07 Thread Su Yanjun
For statx syscall, xfs return the wrong result_mask. Signed-off-by: Su Yanjun --- fs/xfs/xfs_iops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index f48ffd7..3811457 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -521,6 +521,9

[PATCH v2] vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

2019-01-06 Thread Su Yanjun
ual tunnel. Signed-off-by: Su Yanjun --- Based on Linus' master branch. Changes from v1: - use a separate handler for ipip packet processing in ipcomp virtual tunnel net/ipv4/ip_vti.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/net/i

Re: [PATCH] vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

2019-01-04 Thread Su Yanjun
On 1/4/2019 3:43 PM, Steffen Klassert wrote: On Thu, Jan 03, 2019 at 07:48:41AM -0500, Su Yanjun wrote: Recently we run a network test over ipcomp virtual tunnel.We find that if a ipv4 packet needs fragment, then the peer can't receive it. We deep into the code and find that when packet need

[PATCH] vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

2019-01-02 Thread Su Yanjun
ual tunnel. Signed-off-by: Su Yanjun --- net/ipv4/ip_vti.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index de31b30..63de2f6 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -65,6 +65,9 @@ static

[PATCH] ipv6: fix typo in net/ipv6/reassembly.c

2018-12-29 Thread Su Yanjun
Signed-off-by: Su Yanjun --- net/ipv6/reassembly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index a5bb59e..36a3d8d 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -210,7 +210,7 @@ static int ip6_frag_queue