* [PATCH 00/11] Removed a bunch random warnings
@ 2017-07-19 20:53 Steve Dickson
2017-07-19 20:53 ` [PATCH 01/11] rpcdebug.c: remove a warning Steve Dickson
` (10 more replies)
0 siblings, 11 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
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
Steve Dickson (11):
rpcdebug.c: remove a warning
present_address: remove a warning
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 | 1 +
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 | 5 ++++-
utils/nfsdcltrack/nfsdcltrack.c | 1 +
11 files changed, 20 insertions(+), 2 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 01/11] rpcdebug.c: remove a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 02/11] present_address: " Steve Dickson
` (9 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
rpcdebug.c:77:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
tools/rpcdebug/rpcdebug.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/rpcdebug/rpcdebug.c b/tools/rpcdebug/rpcdebug.c
index 18b1622..68206cc 100644
--- a/tools/rpcdebug/rpcdebug.c
+++ b/tools/rpcdebug/rpcdebug.c
@@ -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;
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/11] present_address: remove a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
2017-07-19 20:53 ` [PATCH 01/11] rpcdebug.c: remove a warning Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-20 18:42 ` J. Bruce Fields
2017-07-19 20:53 ` [PATCH 03/11] atomicio: removed " Steve Dickson
` (8 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
tcpwrapper.c:73:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
support/misc/tcpwrapper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/support/misc/tcpwrapper.c b/support/misc/tcpwrapper.c
index 06b0a46..3128053 100644
--- a/support/misc/tcpwrapper.c
+++ b/support/misc/tcpwrapper.c
@@ -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;
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/11] atomicio: removed a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
2017-07-19 20:53 ` [PATCH 01/11] rpcdebug.c: remove a warning Steve Dickson
2017-07-19 20:53 ` [PATCH 02/11] present_address: " Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-20 18:24 ` J. Bruce Fields
2017-07-19 20:53 ` [PATCH 04/11] cache.c: removed a couple warning Steve Dickson
` (7 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
atomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
support/nfs/atomicio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/support/nfs/atomicio.c b/support/nfs/atomicio.c
index 5e760e6..0234072 100644
--- a/support/nfs/atomicio.c
+++ b/support/nfs/atomicio.c
@@ -42,6 +42,7 @@ 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;
case 0:
if (pos != 0)
return pos;
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/11] cache.c: removed a couple warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (2 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 03/11] atomicio: removed " Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 05/11] nfsd.c: removed a few warnings Steve Dickson
` (6 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
cache.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))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mountd/cache.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index ca6c84f..e49300d 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -11,6 +11,7 @@
#include <config.h>
#endif
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/stat.h>
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/11] nfsd.c: removed a few warnings
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (3 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 04/11] cache.c: removed a couple warning Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-20 18:28 ` J. Bruce Fields
2017-07-19 20:53 ` [PATCH 06/11] bldev_read_serial: removed a couple warnings Steve Dickson
` (5 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
nfsd.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=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/nfsd/nfsd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index 2b38249..1d35658 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -198,6 +198,7 @@ main(int argc, char **argv)
minorvers = 0;
minorversset = minormask;
}
+ break;
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;
+ break;
case 3:
case 2:
NFSCTL_VERSET(versbits, c);
@@ -261,8 +263,9 @@ main(int argc, char **argv)
break;
default:
fprintf(stderr, "Invalid argument: '%c'\n", c);
+ /* FALLTHRU */
case 'h':
- usage(progname);
+ usage(progname); /* usage does not return */
}
}
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/11] bldev_read_serial: removed a couple warnings
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (4 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 05/11] nfsd.c: removed a few warnings Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 07/11] device-discovery.c: removed a warning Steve Dickson
` (4 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
device-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=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/blkmapd/device-inq.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
index 0062a8f..c7952c3 100644
--- a/utils/blkmapd/device-inq.c
+++ b/utils/blkmapd/device-inq.c
@@ -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;
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/11] device-discovery.c: removed a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (5 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 06/11] bldev_read_serial: removed a couple warnings Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 08/11] network.c: removed some warnings Steve Dickson
` (3 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
device-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)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/blkmapd/device-discovery.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
index c66669d..29bafb2 100644
--- a/utils/blkmapd/device-discovery.c
+++ b/utils/blkmapd/device-discovery.c
@@ -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>
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/11] network.c: removed some warnings
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (6 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 07/11] device-discovery.c: removed a warning Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-20 18:37 ` J. Bruce Fields
2017-07-19 20:53 ` [PATCH 09/11] nfsmount: remove a warning Steve Dickson
` (2 subsequent siblings)
10 siblings, 1 reply; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
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 <steved@redhat.com>
---
utils/mount/network.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/utils/mount/network.c b/utils/mount/network.c
index 281e935..19f14e5 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1235,6 +1235,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program)
*program = tmp;
return 1;
}
+ break;
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;
}
+ break;
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;
}
+ break;
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;
}
+ break;
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;
}
+ break;
case PO_BAD_VALUE:
nfs_error(_("%s: invalid value for 'mountport=' option"),
progname);
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/11] nfsmount: remove a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (7 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 08/11] network.c: removed some warnings Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 10/11] nfs4mount: removed " Steve Dickson
2017-07-19 20:53 ` [PATCH 11/11] nfsdcltrack.c: remove " Steve Dickson
10 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
nfsmount.c:684:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/nfsmount.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
index 930622d..ae4a3da 100644
--- a/utils/mount/nfsmount.c
+++ b/utils/mount/nfsmount.c
@@ -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;
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/11] nfs4mount: removed a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (8 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 09/11] nfsmount: remove a warning Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 11/11] nfsdcltrack.c: remove " Steve Dickson
10 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
nfs4mount.c:445:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/nfs4mount.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c
index 028e7cd..89629ed 100644
--- a/utils/mount/nfs4mount.c
+++ b/utils/mount/nfs4mount.c
@@ -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;
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 11/11] nfsdcltrack.c: remove a warning
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
` (9 preceding siblings ...)
2017-07-19 20:53 ` [PATCH 10/11] nfs4mount: removed " Steve Dickson
@ 2017-07-19 20:53 ` Steve Dickson
2017-07-20 10:32 ` Jeff Layton
10 siblings, 1 reply; 22+ messages in thread
From: Steve Dickson @ 2017-07-19 20:53 UTC (permalink / raw)
To: Linux NFS Mailing list
nfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/nfsdcltrack/nfsdcltrack.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
index 124c923..0baaa3e 100644
--- a/utils/nfsdcltrack/nfsdcltrack.c
+++ b/utils/nfsdcltrack/nfsdcltrack.c
@@ -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);
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 11/11] nfsdcltrack.c: remove a warning
2017-07-19 20:53 ` [PATCH 11/11] nfsdcltrack.c: remove " Steve Dickson
@ 2017-07-20 10:32 ` Jeff Layton
0 siblings, 0 replies; 22+ messages in thread
From: Jeff Layton @ 2017-07-20 10:32 UTC (permalink / raw)
To: Steve Dickson, Linux NFS Mailing list
On Wed, 2017-07-19 at 16:53 -0400, Steve Dickson wrote:
> nfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
> utils/nfsdcltrack/nfsdcltrack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
> index 124c923..0baaa3e 100644
> --- a/utils/nfsdcltrack/nfsdcltrack.c
> +++ b/utils/nfsdcltrack/nfsdcltrack.c
> @@ -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);
Acked-by: Jeff Layton <jlayton@redhat.com>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/11] atomicio: removed a warning
2017-07-19 20:53 ` [PATCH 03/11] atomicio: removed " Steve Dickson
@ 2017-07-20 18:24 ` J. Bruce Fields
2017-07-21 14:45 ` Steve Dickson
0 siblings, 1 reply; 22+ messages in thread
From: J. Bruce Fields @ 2017-07-20 18:24 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On Wed, Jul 19, 2017 at 04:53:46PM -0400, Steve Dickson wrote:
> atomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
I think this is wrong. For example, if we don't have permission to do
the IO, this causes atomicio() to return 0 instead of -1.
--b.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
> support/nfs/atomicio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/support/nfs/atomicio.c b/support/nfs/atomicio.c
> index 5e760e6..0234072 100644
> --- a/support/nfs/atomicio.c
> +++ b/support/nfs/atomicio.c
> @@ -42,6 +42,7 @@ 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;
> case 0:
> if (pos != 0)
> return pos;
> --
> 2.13.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 05/11] nfsd.c: removed a few warnings
2017-07-19 20:53 ` [PATCH 05/11] nfsd.c: removed a few warnings Steve Dickson
@ 2017-07-20 18:28 ` J. Bruce Fields
2017-07-21 16:20 ` Steve Dickson
0 siblings, 1 reply; 22+ messages in thread
From: J. Bruce Fields @ 2017-07-20 18:28 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On Wed, Jul 19, 2017 at 04:53:48PM -0400, Steve Dickson wrote:
> nfsd.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=]
Are you sure about this? It looks to me like the fall through was
intended in the -N4 and -V4 cases.
--b.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
> utils/nfsd/nfsd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
> index 2b38249..1d35658 100644
> --- a/utils/nfsd/nfsd.c
> +++ b/utils/nfsd/nfsd.c
> @@ -198,6 +198,7 @@ main(int argc, char **argv)
> minorvers = 0;
> minorversset = minormask;
> }
> + break;
> 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;
> + break;
> case 3:
> case 2:
> NFSCTL_VERSET(versbits, c);
> @@ -261,8 +263,9 @@ main(int argc, char **argv)
> break;
> default:
> fprintf(stderr, "Invalid argument: '%c'\n", c);
> + /* FALLTHRU */
> case 'h':
> - usage(progname);
> + usage(progname); /* usage does not return */
> }
> }
>
> --
> 2.13.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 08/11] network.c: removed some warnings
2017-07-19 20:53 ` [PATCH 08/11] network.c: removed some warnings Steve Dickson
@ 2017-07-20 18:37 ` J. Bruce Fields
2017-07-21 16:29 ` Steve Dickson
0 siblings, 1 reply; 22+ messages in thread
From: J. Bruce Fields @ 2017-07-20 18:37 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On Wed, Jul 19, 2017 at 04:53:51PM -0400, Steve Dickson wrote:
> 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=]
Looks like after this an out-of-range port number will be treated as an
unspecified port rather than returning an error. That sounds wrong.
I didn't check the others.
All of these "break" statements added without any explanation are making
me nervous.
--b.
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
> utils/mount/network.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index 281e935..19f14e5 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -1235,6 +1235,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program)
> *program = tmp;
> return 1;
> }
> + break;
> 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;
> }
> + break;
> 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;
> }
> + break;
> 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;
> }
> + break;
> 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;
> }
> + break;
> case PO_BAD_VALUE:
> nfs_error(_("%s: invalid value for 'mountport=' option"),
> progname);
> --
> 2.13.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 02/11] present_address: remove a warning
2017-07-19 20:53 ` [PATCH 02/11] present_address: " Steve Dickson
@ 2017-07-20 18:42 ` J. Bruce Fields
0 siblings, 0 replies; 22+ messages in thread
From: J. Bruce Fields @ 2017-07-20 18:42 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On Wed, Jul 19, 2017 at 04:53:45PM -0400, Steve Dickson wrote:
> tcpwrapper.c:73:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
This one looks like a real bugfix to me; could use a changelog.
--b.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
> support/misc/tcpwrapper.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/support/misc/tcpwrapper.c b/support/misc/tcpwrapper.c
> index 06b0a46..3128053 100644
> --- a/support/misc/tcpwrapper.c
> +++ b/support/misc/tcpwrapper.c
> @@ -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;
> --
> 2.13.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 03/11] atomicio: removed a warning
2017-07-20 18:24 ` J. Bruce Fields
@ 2017-07-21 14:45 ` Steve Dickson
0 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-21 14:45 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Linux NFS Mailing list
On 07/20/2017 02:24 PM, J. Bruce Fields wrote:
> On Wed, Jul 19, 2017 at 04:53:46PM -0400, Steve Dickson wrote:
>> atomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
> I think this is wrong. For example, if we don't have permission to do
> the IO, this causes atomicio() to return 0 instead of -1.
I see your point... Nice catch!
steved.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 05/11] nfsd.c: removed a few warnings
2017-07-20 18:28 ` J. Bruce Fields
@ 2017-07-21 16:20 ` Steve Dickson
0 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-21 16:20 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Linux NFS Mailing list
On 07/20/2017 02:28 PM, J. Bruce Fields wrote:
> On Wed, Jul 19, 2017 at 04:53:48PM -0400, Steve Dickson wrote:
>> nfsd.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=]
>
> Are you sure about this? It looks to me like the fall through was
> intended in the -N4 and -V4 cases.
Wow... how un-obvious that! The -N4 actually does use the
NFSCTL_VERUNSET() in the 3,2 case... Talk about in needed
of a comment! ;-)
steved.
>
> --b.
>
>>
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>> utils/nfsd/nfsd.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
>> index 2b38249..1d35658 100644
>> --- a/utils/nfsd/nfsd.c
>> +++ b/utils/nfsd/nfsd.c
>> @@ -198,6 +198,7 @@ main(int argc, char **argv)
>> minorvers = 0;
>> minorversset = minormask;
>> }
>> + break;
>> 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;
>> + break;
>> case 3:
>> case 2:
>> NFSCTL_VERSET(versbits, c);
>> @@ -261,8 +263,9 @@ main(int argc, char **argv)
>> break;
>> default:
>> fprintf(stderr, "Invalid argument: '%c'\n", c);
>> + /* FALLTHRU */
>> case 'h':
>> - usage(progname);
>> + usage(progname); /* usage does not return */
>> }
>> }
>>
>> --
>> 2.13.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 08/11] network.c: removed some warnings
2017-07-20 18:37 ` J. Bruce Fields
@ 2017-07-21 16:29 ` Steve Dickson
2017-07-21 18:30 ` J. Bruce Fields
0 siblings, 1 reply; 22+ messages in thread
From: Steve Dickson @ 2017-07-21 16:29 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Linux NFS Mailing list
On 07/20/2017 02:37 PM, J. Bruce Fields wrote:
> On Wed, Jul 19, 2017 at 04:53:51PM -0400, Steve Dickson wrote:
>> 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=]
>
> Looks like after this an out-of-range port number will be treated as an
> unspecified port rather than returning an error. That sounds wrong.
>
> I didn't check the others.
>
> All of these "break" statements added without any explanation are making
> me nervous.
Yeah you are right... Boy there are some subtle things going there...
Thanks for the review and cycles!
steved.
>
> --b.
>
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>> utils/mount/network.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/utils/mount/network.c b/utils/mount/network.c
>> index 281e935..19f14e5 100644
>> --- a/utils/mount/network.c
>> +++ b/utils/mount/network.c
>> @@ -1235,6 +1235,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program)
>> *program = tmp;
>> return 1;
>> }
>> + break;
>> 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;
>> }
>> + break;
>> 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;
>> }
>> + break;
>> 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;
>> }
>> + break;
>> 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;
>> }
>> + break;
>> case PO_BAD_VALUE:
>> nfs_error(_("%s: invalid value for 'mountport=' option"),
>> progname);
>> --
>> 2.13.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 08/11] network.c: removed some warnings
2017-07-21 16:29 ` Steve Dickson
@ 2017-07-21 18:30 ` J. Bruce Fields
0 siblings, 0 replies; 22+ messages in thread
From: J. Bruce Fields @ 2017-07-21 18:30 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On Fri, Jul 21, 2017 at 12:29:12PM -0400, Steve Dickson wrote:
>
>
> On 07/20/2017 02:37 PM, J. Bruce Fields wrote:
> > On Wed, Jul 19, 2017 at 04:53:51PM -0400, Steve Dickson wrote:
> >> 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=]
> >
> > Looks like after this an out-of-range port number will be treated as an
> > unspecified port rather than returning an error. That sounds wrong.
> >
> > I didn't check the others.
> >
> > All of these "break" statements added without any explanation are making
> > me nervous.
> Yeah you are right... Boy there are some subtle things going there...
>
> Thanks for the review and cycles!
If you respin these patches, it'd be helpful to either add a short
comment explaining why the fallthrough is correct, or if you add a
break, explain in the changelog why the old behavior was wrong and
whether there was an actual user-visible bug.
Totally understood if that's too much work to be worth it right now, but
then I'd rather let the warnings wait a little longer. If that makes it
hard to see real warnings, then we can turn off those compiler flags for
now. Quick fixes to shut up warnings can be as risky as missed
warnings.
--b.
>
> steved.
>
> >
> > --b.
> >
> >> Signed-off-by: Steve Dickson <steved@redhat.com>
> >> ---
> >> utils/mount/network.c | 5 +++++
> >> 1 file changed, 5 insertions(+)
> >>
> >> diff --git a/utils/mount/network.c b/utils/mount/network.c
> >> index 281e935..19f14e5 100644
> >> --- a/utils/mount/network.c
> >> +++ b/utils/mount/network.c
> >> @@ -1235,6 +1235,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program)
> >> *program = tmp;
> >> return 1;
> >> }
> >> + break;
> >> 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;
> >> }
> >> + break;
> >> 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;
> >> }
> >> + break;
> >> 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;
> >> }
> >> + break;
> >> 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;
> >> }
> >> + break;
> >> case PO_BAD_VALUE:
> >> nfs_error(_("%s: invalid value for 'mountport=' option"),
> >> progname);
> >> --
> >> 2.13.3
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 05/11] nfsd.c: removed a few warnings
2017-07-21 16:37 [PATCH 00/11 V2] Removed a bunch random warnings Steve Dickson
@ 2017-07-21 16:38 ` Steve Dickson
0 siblings, 0 replies; 22+ messages in thread
From: Steve Dickson @ 2017-07-21 16:38 UTC (permalink / raw)
To: Linux NFS Mailing list
nfsd.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=]
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/nfsd/nfsd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index 2b38249..f973203 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -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);
}
--
2.13.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
end of thread, other threads:[~2017-07-21 18:30 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 20:53 [PATCH 00/11] Removed a bunch random warnings Steve Dickson
2017-07-19 20:53 ` [PATCH 01/11] rpcdebug.c: remove a warning Steve Dickson
2017-07-19 20:53 ` [PATCH 02/11] present_address: " Steve Dickson
2017-07-20 18:42 ` J. Bruce Fields
2017-07-19 20:53 ` [PATCH 03/11] atomicio: removed " Steve Dickson
2017-07-20 18:24 ` J. Bruce Fields
2017-07-21 14:45 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 04/11] cache.c: removed a couple warning Steve Dickson
2017-07-19 20:53 ` [PATCH 05/11] nfsd.c: removed a few warnings Steve Dickson
2017-07-20 18:28 ` J. Bruce Fields
2017-07-21 16:20 ` Steve Dickson
2017-07-19 20:53 ` [PATCH 06/11] bldev_read_serial: removed a couple warnings Steve Dickson
2017-07-19 20:53 ` [PATCH 07/11] device-discovery.c: removed a warning Steve Dickson
2017-07-19 20:53 ` [PATCH 08/11] network.c: removed some warnings Steve Dickson
2017-07-20 18:37 ` J. Bruce Fields
2017-07-21 16:29 ` Steve Dickson
2017-07-21 18:30 ` J. Bruce Fields
2017-07-19 20:53 ` [PATCH 09/11] nfsmount: remove a warning Steve Dickson
2017-07-19 20:53 ` [PATCH 10/11] nfs4mount: removed " Steve Dickson
2017-07-19 20:53 ` [PATCH 11/11] nfsdcltrack.c: remove " Steve Dickson
2017-07-20 10:32 ` Jeff Layton
2017-07-21 16:37 [PATCH 00/11 V2] Removed a bunch random warnings Steve Dickson
2017-07-21 16:38 ` [PATCH 05/11] nfsd.c: removed a few warnings Steve Dickson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.