filefrag: fix fibmap error message
cover filefrag: fix fibmap error message
There's a silly mistake in misc/filefrag.c. It's a single character change.
get_block() of various fs can return any errno at all. FUSE is especially wild west out there and the fact that POSIX allowing NULL and Musl simply refusing to snprintf() doesn't really help either...
David Timber (1):
filefrag: fix fibmap error message
misc/filefrag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.53.0.1.ga224b40d3f.dirty
PATCH 1/1 filefrag: fix fibmap error message
When an errno other than EINVAL, ENOTTY or EPERM is returned from FIBMAP ioctl, the negative errno is passsed to strerror(), which only accepts positive errno values.
--- misc/filefrag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
misc/filefrag.c +1 -1
@@ -517,7 +517,7 @@ static int frag_report(const char *filename) filename); }else {fprintf (stderr,"%s: FIBMAP error: %s" , - filename,strerror (expected)); + filename,strerror (-expected)); } rc = expected; goto out_close;
Signature · 1 line
2.53.0.1.ga224b40d3f.dirty
Quoted 6 lines · David Timber
When an errno other than EINVAL, ENOTTY or EPERM is returned from FIBMAP ioctl, the negative errno is passsed to
strerror(), which only accepts positive errno values.Signed-off-by David Timber <[email protected]>
Quoted 21 lines
---
misc/filefrag.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)misc/filefrag.c +1
-1@@ -517,7 +517,7 @@ static int frag_report(const char *filename) filename); }else {fprintf (stderr,"%s: FIBMAP error: %s" , - filename,strerror (expected)); + filename,strerror (-expected)); } rc = expected; goto out_close;Signature · 1 line
2.53.0.1.ga224b40d3f.dirty
Quoted 4 lines · David Timber
When an errno other than EINVAL, ENOTTY or EPERM is returned from FIBMAP ioctl, the negative errno is passsed to
strerror(), which only accepts positive errno values.
LGTM.
Quoted 20 lines
Signed-off-by David Timber <[email protected]>--- misc/filefrag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)misc/filefrag.c +1
-1@@ -517,7 +517,7 @@ static int frag_report(const char *filename) filename); }else {fprintf (stderr,"%s: FIBMAP error: %s" , - filename,strerror (expected)); + filename,strerror (-expected)); } rc = expected; goto out_close;Signature · 1 line
2.53.0.1.ga224b40d3f.dirty