Removed a bunch random warnings
Subsystems (2)
v2 cover Removed a bunch random warnings
I upgraded to Fedora 26 and went to apply Neil's recent mount patches and ended up seeing all these warning.
These patches fix those warnings
v2: change a changelog that explicitly fixes a bug.
Changed a number of break statements into FALLTHRU comments.
Steve Dickson (11):
rpcdebug.c: remove a warning
present_address: Fixed error path
atomicio: removed a warning
cache.c: removed a couple warning
nfsd.c: removed a few warnings
bldev_read_serial: removed a couple warnings
device-discovery.c: removed a warning
network.c: removed some warnings
nfsmount: remove a warning
nfs4mount: removed a warning
nfsdcltrack.c: remove a warning
support/misc/tcpwrapper.c | 1 + support/nfs/atomicio.c | 2 ++ tools/rpcdebug/rpcdebug.c | 3 ++- utils/blkmapd/device-discovery.c | 1 + utils/blkmapd/device-inq.c | 2 ++ utils/mount/network.c | 5 +++++ utils/mount/nfs4mount.c | 1 + utils/mount/nfsmount.c | 1 + utils/mountd/cache.c | 1 + utils/nfsd/nfsd.c | 3 +++ utils/nfsdcltrack/nfsdcltrack.c | 1 + 11 files changed, 20 insertions(+), 1 deletion(-)
Signature · 1 line
2.13.3
PATCH v2 1/11 rpcdebug.c: remove a warning
rpcdebug.c:77:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- tools/rpcdebug/rpcdebug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/rpcdebug/rpcdebug.c +2 -1
@@ -74,7 +74,8 @@ main(int argc, char **argv) opt_c =1 ;break ;case 'h' : -usage (0 , module); +usage (0 , module);/* usage does not return */ +break ;case 'm' : module = optarg;break ;
Signature · 1 line
2.13.3
PATCH v2 2/11 present_address: Fixed error path
In reply to Steve DicksonWhen inet_ntop fails do not fall into the AF_INET6 case, instead break out and take the error path out.
--- support/misc/tcpwrapper.c | 1 + 1 file changed, 1 insertion(+)
support/misc/tcpwrapper.c +1 -0
@@ -72,6 +72,7 @@ present_address(const struct sockaddr *sap, char *buf, const size_t buflen)case AF_INET :if (inet_ntop (AF_INET , &sin->sin_addr, buf, len) !=0 )return ; +break ;case AF_INET6 :if (inet_ntop (AF_INET6 , &sin6->sin6_addr, buf, len) !=0 )return ;
Signature · 1 line
2.13.3
PATCH v2 3/11 atomicio: removed a warning
In reply to Steve Dicksonatomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- support/nfs/atomicio.c | 2 ++ 1 file changed, 2 insertions(+)
support/nfs/atomicio.c +2 -0
@@ -42,6 +42,8 @@ ssize_t atomicio(ssize_t(*f) (int, void *, size_t), int fd, void *_s, size_t n)case -1 :if (errno ==EINTR || errno ==EAGAIN )continue ; +break ; +/* FALLTHRU */ case 0 :if (pos !=0 )return pos;
Signature · 1 line
2.13.3
Re: [PATCH 03/11] atomicio: removed a warning
Quoted 12 lines · Steve Dickson
atomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Steve Dickson <[email protected]>--- support/nfs/atomicio.c | 2 ++ 1 file changed, 2 insertions(+)support/nfs/atomicio.c +0
-0
support/nfs/atomicio.c ssize_t atomicio(ssize_t(*f) (int, void *, size_t), int fd, void *_s, size_t n) · line 46
Quoted 5 lines
support/nfs/atomicio.c +2
-0@@ -42,6 +42,8 @@ ssize_t atomicio(ssize_t(*f) (int, void *, size_t), int fd, void *_s, size_t n)case -1 :if (errno ==EINTR || errno ==EAGAIN )continue ; +break ; +/* FALLTHRU */
And I thought I was confused before!
--b.
Quoted 10 lines
support/nfs/atomicio.c +0
-0case 0 :if (pos !=0 )return pos;Signature · 6 lines
2.13.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 4/11 cache.c: removed a couple warning
In reply to Steve Dicksoncache.c:623:13: warning: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>.
if (parsed->major != major(stb.st_dev) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cache.c:624:13: warning: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>.
parsed->minor != minor(stb.st_dev))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~--- utils/mountd/cache.c | 1 + 1 file changed, 1 insertion(+)
utils/mountd/cache.c +1 -0
@@ -11,6 +11,7 @@#include <config.h> #endif +#include <sys/sysmacros.h> #include <sys/types.h> #include <sys/select.h> #include <sys/stat.h>
Signature · 1 line
2.13.3
PATCH v2 5/11 nfsd.c: removed a few warnings
In reply to Steve Dicksonnfsd.c:187:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
nfsd.c:213:8: warning: this statement may fall through [-Wimplicit-fallthrough=]nfsd.c:263:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- utils/nfsd/nfsd.c | 3 +++ 1 file changed, 3 insertions(+)
utils/nfsd/nfsd.c +3 -0
@@ -198,6 +198,7 @@ main(int argc, char **argv) minorvers =0 ; minorversset = minormask; } +/* FALLTHRU */ case 3 :case 2 :NFSCTL_VERUNSET (versbits, c);
@@ -220,6 +221,7 @@ main(int argc, char **argv)NFSCTL_MINORSET (minorvers, i); }else minorvers = minorversset = minormask; +/* FALLTHRU */ case 3 :case 2 :NFSCTL_VERSET (versbits, c);
@@ -261,6 +263,7 @@ main(int argc, char **argv)break ;default :fprintf (stderr,"Invalid argument: '%c'\n" , c); +/* FALLTHRU */ case 'h' :usage (progname); }
Signature · 1 line
2.13.3
PATCH v2 6/11 bldev_read_serial: removed a couple warnings
In reply to Steve Dicksondevice-inq.c:216:7: warning: this statement may fall through [-Wimplicit-fallthrough=] device-inq.c:223:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- utils/blkmapd/device-inq.c | 2 ++ 1 file changed, 2 insertions(+)
utils/blkmapd/device-inq.c +2 -0
@@ -216,6 +216,7 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)if ((dev_id->len !=8 ) && (dev_id->len !=12 ) && (dev_id->len !=16 ))break ; +/* FALLTHRU */ case 3 :/* NAA */ /* TODO: NAA validity judgement too complicated, * so just ingore it here.
@@ -224,6 +225,7 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)BL_LOG_ERR ("Binary code_set expected\n" );break ; } +/* FALLTHRU */ case 0 :/* vendor specific */ case 1 :/* T10 vendor identification */ current_id = dev_id->ids &0xf ;
Signature · 1 line
2.13.3
PATCH v2 7/11 device-discovery.c: removed a warning
In reply to Steve Dicksondevice-discovery.c:171:13: warning: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>.
} else if (dm_is_dm_major(major(dev)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
--- utils/blkmapd/device-discovery.c | 1 + 1 file changed, 1 insertion(+)
utils/blkmapd/device-discovery.c +1 -0
@@ -26,6 +26,7 @@* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/sysmacros.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h>
Signature · 1 line
2.13.3
PATCH v2 8/11 network.c: removed some warnings
In reply to Steve Dicksonnetwork.c:1234:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1382:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1477:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1508:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1574:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- utils/mount/network.c | 5 +++++ 1 file changed, 5 insertions(+)
utils/mount/network.c +5 -0
@@ -1235,6 +1235,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program) *program = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'nfsprog=' option" ), progname);
@@ -1383,6 +1384,7 @@ nfs_nfs_port(struct mount_options *options, unsigned long *port) *port = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'port=' option" ), progname);
@@ -1478,6 +1480,7 @@ nfs_mount_program(struct mount_options *options, unsigned long *program) *program = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'mountprog=' option" ), progname);
@@ -1509,6 +1512,7 @@ nfs_mount_version(struct mount_options *options, unsigned long *version) *version = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'mountvers=' option" ), progname);
@@ -1575,6 +1579,7 @@ nfs_mount_port(struct mount_options *options, unsigned long *port) *port = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'mountport=' option" ), progname);
Signature · 1 line
2.13.3
Re: [PATCH 08/11] network.c: removed some warnings
Quoted 31 lines · Steve Dickson
network.c:1234:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1382:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1477:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1508:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1574:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 5 +++++ 1 file changed, 5 insertions(+)utils/mount/network.c +2
-0@@ -1235,6 +1235,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program) *program = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'nfsprog=' option" ), progname);@@ -1383,6 +1384,7 @@ nfs_nfs_port(struct mount_options *options, unsigned long *port) *port = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'port=' option" ), progname);
utils/mount/network.c nfs_mount_program(struct mount_options *options, unsigned long *program) · line 1483
Quoted 4 lines
utils/mount/network.c +1
-0@@ -1478,6 +1480,7 @@ nfs_mount_program(struct mount_options *options, unsigned long *program) *program = tmp;return 1 ; } +/* FALLTHRU */
Indentation nit.
--b.
Quoted 26 lines
utils/mount/network.c +2
-0case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'mountprog=' option" ), progname);@@ -1509,6 +1512,7 @@ nfs_mount_version(struct mount_options *options, unsigned long *version) *version = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'mountvers=' option" ), progname);@@ -1575,6 +1579,7 @@ nfs_mount_port(struct mount_options *options, unsigned long *port) *port = tmp;return 1 ; } +/* FALLTHRU */ case PO_BAD_VALUE :nfs_error (_ ("%s: invalid value for 'mountport=' option" ), progname);Signature · 6 lines
2.13.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 9/11 nfsmount: remove a warning
In reply to Steve Dicksonnfsmount.c:684:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- utils/mount/nfsmount.c | 1 + 1 file changed, 1 insertion(+)
utils/mount/nfsmount.c +1 -0
@@ -683,6 +683,7 @@ nfsmount(const char *spec, const char *node, int flags,case RPC_SYSTEMERROR :if (errno ==ETIMEDOUT )break ; +/* FALLTHRU */ default :rpc_mount_errors (*nfs_server.hostname,0 , bg); goto fail;
Signature · 1 line
2.13.3
PATCH v2 10/11 nfs4mount: removed a warning
In reply to Steve Dicksonnfs4mount.c:445:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- utils/mount/nfs4mount.c | 1 + 1 file changed, 1 insertion(+)
utils/mount/nfs4mount.c +1 -0
@@ -444,6 +444,7 @@ int nfs4mount(const char *spec, const char *node, int flags,case RPC_SYSTEMERROR :if (errno ==ETIMEDOUT )break ; +/* FALLTHRU */ default :rpc_mount_errors (hostname,0 , bg); goto fail;
Signature · 1 line
2.13.3
PATCH v2 11/11 nfsdcltrack.c: remove a warning
In reply to Steve Dicksonnfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
--- utils/nfsdcltrack/nfsdcltrack.c | 1 + 1 file changed, 1 insertion(+)
utils/nfsdcltrack/nfsdcltrack.c +1 -0
@@ -579,6 +579,7 @@ main(int argc, char **argv)switch (arg) {case 'd' :xlog_config (D_ALL ,1 ); +break ;case 'f' :xlog_syslog (0 );xlog_stderr (1 );
Signature · 1 line
2.13.3
Quoted 7 lines · Steve Dickson
I upgraded to Fedora 26 and went to apply Neil's recent mount patches and ended up seeing all these warning.
These patches fix those warnings
v2: change a changelog that explicitly fixes a bug.
Changed a number of break statements into FALLTHRU comments.
Looks good to me, except for the obvious mistake on #3 (and one whitespace nit).
Thanks!--b.
Quoted 34 lines
Steve Dickson (11):
rpcdebug.c: remove a warning
present_address: Fixed error path
atomicio: removed a warning
cache.c: removed a couple warning
nfsd.c: removed a few warnings
bldev_read_serial: removed a couple warnings
device-discovery.c: removed a warning
network.c: removed some warnings
nfsmount: remove a warning
nfs4mount: removed a warning
nfsdcltrack.c: remove a warningsupport/misc/tcpwrapper.c | 1 + support/nfs/atomicio.c | 2 ++ tools/rpcdebug/rpcdebug.c | 3 ++- utils/blkmapd/device-discovery.c | 1 + utils/blkmapd/device-inq.c | 2 ++ utils/mount/network.c | 5 +++++ utils/mount/nfs4mount.c | 1 + utils/mount/nfsmount.c | 1 + utils/mountd/cache.c | 1 + utils/nfsd/nfsd.c | 3 +++ utils/nfsdcltrack/nfsdcltrack.c | 1 + 11 files changed, 20 insertions(+), 1 deletion(-)Signature · 6 lines
2.13.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · J. Bruce Fields
Quoted 7 lines · Steve Dickson
I upgraded to Fedora 26 and went to apply Neil's recent mount patches and ended up seeing all these warning.
These patches fix those warnings
v2: change a changelog that explicitly fixes a bug.
Changed a number of break statements into FALLTHRU comments.Looks good to me, except for the obvious mistake on #3 (and one whitespace nit).
I'll fix both on the commit...
Thanks for the review!
steved.
Quoted 37 lines
Thanks!--b.
Quoted 34 lines
Steve Dickson (11):
rpcdebug.c: remove a warning
present_address: Fixed error path
atomicio: removed a warning
cache.c: removed a couple warning
nfsd.c: removed a few warnings
bldev_read_serial: removed a couple warnings
device-discovery.c: removed a warning
network.c: removed some warnings
nfsmount: remove a warning
nfs4mount: removed a warning
nfsdcltrack.c: remove a warningsupport/misc/tcpwrapper.c | 1 + support/nfs/atomicio.c | 2 ++ tools/rpcdebug/rpcdebug.c | 3 ++- utils/blkmapd/device-discovery.c | 1 + utils/blkmapd/device-inq.c | 2 ++ utils/mount/network.c | 5 +++++ utils/mount/nfs4mount.c | 1 + utils/mount/nfsmount.c | 1 + utils/mountd/cache.c | 1 + utils/nfsd/nfsd.c | 3 +++ utils/nfsdcltrack/nfsdcltrack.c | 1 + 11 files changed, 20 insertions(+), 1 deletion(-)Signature · 6 lines
2.13.3 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 21 lines · Steve Dickson
I upgraded to Fedora 26 and went to apply Neil's recent mount patches and ended up seeing all these warning.
These patches fix those warnings
v2: change a changelog that explicitly fixes a bug.
Changed a number of break statements into FALLTHRU comments.Steve Dickson (11):
rpcdebug.c: remove a warning
present_address: Fixed error path
atomicio: removed a warning
cache.c: removed a couple warning
nfsd.c: removed a few warnings
bldev_read_serial: removed a couple warnings
device-discovery.c: removed a warning
network.c: removed some warnings
nfsmount: remove a warning
nfs4mount: removed a warning
nfsdcltrack.c: remove a warning
Quoted 13 lines
support/misc/tcpwrapper.c | 1 + support/nfs/atomicio.c | 2 ++ tools/rpcdebug/rpcdebug.c | 3 ++- utils/blkmapd/device-discovery.c | 1 + utils/blkmapd/device-inq.c | 2 ++ utils/mount/network.c | 5 +++++ utils/mount/nfs4mount.c | 1 + utils/mount/nfsmount.c | 1 + utils/mountd/cache.c | 1 + utils/nfsd/nfsd.c | 3 +++ utils/nfsdcltrack/nfsdcltrack.c | 1 + 11 files changed, 20 insertions(+), 1 deletion(-)
Committed... Fixing those two issues Bruce point out.
steved.