diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-30 10:31:36 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-30 11:08:46 +0200 |
commit | 5473abac14fdb1ba1cd4599175a1ac17bd5ee3d1 (patch) | |
tree | be6d2af838d6b460752eb81a7ca402baa8755147 /fs/nfs.c | |
parent | d8d36e5682dc9f2fefffb7a938915d67bb1be223 (diff) | |
download | barebox-5473abac14fdb1ba1cd4599175a1ac17bd5ee3d1.tar.gz barebox-5473abac14fdb1ba1cd4599175a1ac17bd5ee3d1.tar.xz |
nfs: Fix polling for packets
It can happen that the first packet we receive is not the desired one.
In this case we have to poll for further packets. set nfs_state back to
STATE_START before polling for more packets, otherwise we check the same
packet again and again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/nfs.c')
-rw-r--r-- | fs/nfs.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -450,14 +450,17 @@ again: nfs_timer_start = get_time_ns(); - nfs_state = STATE_START; + while (1) { + nfs_state = STATE_START; - while (nfs_state != STATE_DONE) { if (ctrlc()) return ERR_PTR(-EINTR); net_poll(); + if (nfs_state != STATE_DONE) + continue; + if (is_timeout(nfs_timer_start, NFS_TIMEOUT)) { tries++; if (tries == NFS_MAX_RESEND) |