Linux NFS development
 help / color / mirror / Atom feed
From: Robert Schiele <rschiele@gmail.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] use NFS4_MAXMINOR instead of hard coded number
Date: Fri, 24 Jan 2014 07:32:02 +0100	[thread overview]
Message-ID: <20140124063202.GA23937@ulegcprs1.emea.nsn-net.net> (raw)

In utils/nfsd/nfsd.c we used hard coded number 2 in option parsing
when referring to NFS4_MAXMINOR.  We should use the defined constant
instead to honor changes to that constant.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
---

This is obviously a rather trivial patch but the hard coded number
hit me when trying to support various kernels with different support
levels.

 utils/nfsd/nfsd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index a9d77ab..c129ee5 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -160,7 +160,7 @@ main(int argc, char **argv)
 			case 4:
 				if (*p == '.') {
 					int i = atoi(p+1);
-					if (i > 2) {
+					if (i > NFS4_MAXMINOR) {
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
@@ -181,7 +181,7 @@ main(int argc, char **argv)
 			case 4:
 				if (*p == '.') {
 					int i = atoi(p+1);
-					if (i > 2) {
+					if (i > NFS4_MAXMINOR) {
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-- 
1.8.4

             reply	other threads:[~2014-01-24  6:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-24  6:32 Robert Schiele [this message]
2014-01-24 19:28 ` [PATCH] use NFS4_MAXMINOR instead of hard coded number J. Bruce Fields
2014-01-25  4:23   ` Robert Schiele
2014-01-27 14:34     ` J. Bruce Fields
2014-01-27 14:55       ` Robert Schiele
2014-01-27 14:57         ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140124063202.GA23937@ulegcprs1.emea.nsn-net.net \
    --to=rschiele@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox