linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Psurek <philipp.psurek@gmail.com>
To: linux-nfs@vger.kernel.org
Subject: Re: tools/locktest/testlk.c:84: argument 4 has type ‘__off64_t {aka long long int}’
Date: Sun, 03 Jun 2018 18:34:53 +0200	[thread overview]
Message-ID: <1528043693.3598.6.camel@gmail.com> (raw)
In-Reply-To: <1528043420.3598.4.camel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 88 bytes --]

Hi again,

i see, email likes also no tabs. Patch as attachment.

best regards
  Philipp

[-- Attachment #2: testlk.c.patch --]
[-- Type: text/x-patch, Size: 1050 bytes --]

fl.l_start and fl.l_len are 64 bit wide. It has been assumed that long
is 64 bit in a printf(), which is incorrect on a 32 bit archtecture

* 1st change suppress fall through warning from gcc-7 and higher
* 2nd change removes whitespace
* 3rd change is this bug and changes this into a long long

Signed-off-by: Philipp Psurek <philipp.psurek@gmail.com>
---

--- a/tools/locktest/testlk.c    2018-05-22 20:33:01.000000000 +0200
+++ b/tools/locktest/testlk.c    2018-06-03 17:26:36.800202901 +0200
@@ -28,6 +28,7 @@
 		switch (c) {
 		case 'h':
 			usage(0);
+			/* fall through */
 		case 'r':
 			cmd = F_SETLK;
 			typ = F_RDLCK;
@@ -75,13 +76,13 @@
 	if (fcntl(fd, cmd, &fl) < 0)
 		fatal("fcntl");
 	printf("fcntl: ok\n");
-	
+
 	/* printf("TP2\n"); */
 	if (cmd == F_GETLK) {
 		if (fl.l_type == F_UNLCK) {
 			printf("%s: no conflicting lock\n", fname);
 		} else {
-			printf("%s: conflicting lock by %d on (%ld;%ld)\n",
+			printf("%s: conflicting lock by %d on (%lld;%lld)\n",
 				fname, fl.l_pid, fl.l_start, fl.l_len);
 		}
 		return 0;


      reply	other threads:[~2018-06-03 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03 16:30 tools/locktest/testlk.c:84: argument 4 has type ‘__off64_t {aka long long int}’ Philipp Psurek
2018-06-03 16:34 ` Philipp Psurek [this message]

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=1528043693.3598.6.camel@gmail.com \
    --to=philipp.psurek@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;
as well as URLs for NNTP newsgroup(s).