diff mbox series

[U-Boot] net: nfs: don't fail when nfs_read_reply returns -NFS_RPC_DROP

Message ID 20180514153436.8978-1-anarsoul@gmail.com
State Accepted
Commit d48d40a09127dfcb1f073c3e44de4b858393ae9e
Delegated to: Joe Hershberger
Headers show
Series [U-Boot] net: nfs: don't fail when nfs_read_reply returns -NFS_RPC_DROP | expand

Commit Message

Vasily Khoruzhick May 14, 2018, 3:34 p.m. UTC
That can happen if duplicate UDP packet arrived, and that's not uncommon.
Anyway, we ignore packets with rpc_id lower than last we sent for other
requests, so it makes sense to do that for read request as well.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 net/nfs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Joe Hershberger May 16, 2018, 10:26 p.m. UTC | #1
On Mon, May 14, 2018 at 10:34 AM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> That can happen if duplicate UDP packet arrived, and that's not uncommon.
> Anyway, we ignore packets with rpc_id lower than last we sent for other
> requests, so it makes sense to do that for read request as well.
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Vasily Khoruzhick June 5, 2018, 2:53 a.m. UTC | #2
On Wed, May 16, 2018 at 3:26 PM Joe Hershberger <joe.hershberger@ni.com> wrote:
>
> On Mon, May 14, 2018 at 10:34 AM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> > That can happen if duplicate UDP packet arrived, and that's not uncommon.
> > Anyway, we ignore packets with rpc_id lower than last we sent for other
> > requests, so it makes sense to do that for read request as well.
> >
> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Hey,

Can anyone pick this patch up?

Regards,
Vasily
Joe Hershberger June 6, 2018, 10:25 p.m. UTC | #3
On Mon, Jun 4, 2018 at 9:53 PM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> On Wed, May 16, 2018 at 3:26 PM Joe Hershberger <joe.hershberger@ni.com> wrote:
>>
>> On Mon, May 14, 2018 at 10:34 AM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>> > That can happen if duplicate UDP packet arrived, and that's not uncommon.
>> > Anyway, we ignore packets with rpc_id lower than last we sent for other
>> > requests, so it makes sense to do that for read request as well.
>> >
>> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>>
>> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
>
> Hey,
>
> Can anyone pick this patch up?

Will do.

-Joe
Joe Hershberger June 13, 2018, 7:01 p.m. UTC | #4
Hi Vasily,

https://patchwork.ozlabs.org/patch/913047/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe
diff mbox series

Patch

diff --git a/net/nfs.c b/net/nfs.c
index 83ed0a7c37..9a16765ba1 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -822,6 +822,8 @@  static void nfs_handler(uchar *pkt, unsigned dest, struct in_addr sip,
 
 	case STATE_READ_REQ:
 		rlen = nfs_read_reply(pkt, len);
+		if (rlen == -NFS_RPC_DROP)
+			break;
 		net_set_timeout_handler(nfs_timeout, nfs_timeout_handler);
 		if (rlen > 0) {
 			nfs_offset += rlen;