devlink: fix devlink flash error reporting
Subsystems (2)
PATCH 1/1 devlink: fix devlink flash error reporting
Currently, devlink silently exits when a non-existent device is specified for flashing or when the user lacks sufficient permissions. This makes it hard to diagnose the problem.
Print an appropriate error message in these cases to improve user feedback.
Prior:
$ devlink dev flash foo/bar file test $ sudo devlink dev flash foo/bar file test $
After patch:
$ devlink/devlink dev flash foo/bar file test devlink answers: Operation not permitted $ sudo devlink/devlink dev flash foo/bar file test devlink answers: No such device
--- devlink/devlink.c | 2 ++ 1 file changed, 2 insertions(+)
devlink/devlink.c +2 -0
@@ -4594,6 +4594,8 @@ static int cmd_dev_flash(struct dl *dl) }while (!ctx.flash_done || (ctx.not_first && !ctx.received_end)); err =mnlu_gen_socket_recv_run (&dl->nlg,NULL ,NULL ); +if (err <0 ) +pr_err ("devlink answers: %s\n" ,strerror (errno)); out:close (pipe_r);
Signature · 1 line
2.51.0
Quoted 11 lines · Wed, Oct 22, 2025 at 02:23:02PM +0200, [email protected] wrote:
Currently, devlink silently exits when a non-existent device is specified for flashing or when the user lacks sufficient permissions. This makes it hard to diagnose the problem.
Print an appropriate error message in these cases to improve user feedback.
Prior:
$ devlink dev flash foo/bar file test $ sudo devlink dev flash foo/bar file test $
Quoted 8 lines
After patch:
$ devlink/devlink dev flash foo/bar file test devlink answers: Operation not permitted $ sudo devlink/devlink dev flash foo/bar file test devlink answers: No such deviceFixes 9b13cddfe268 ("devlink: implement flash status monitoring")Signed-off-by Ivan Vecera <[email protected]>
Thanks!
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Quoted 4 lines · On Wed, 22 Oct 2025 14:23:02 +0200 you wrote:
Currently, devlink silently exits when a non-existent device is specified for flashing or when the user lacks sufficient permissions. This makes it hard to diagnose the problem.
Quoted 8 lines
Print an appropriate error message in these cases to improve user feedback.
Prior:
$ devlink dev flash foo/bar file test $ sudo devlink dev flash foo/bar file test $[...]
Here is the summary with links:
- [iproute2] devlink: fix devlink flash error reporting
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=ab785eff0b1b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html