linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: fstests@vger.kernel.org, amir73il@gmail.com
Cc: Chandan Rajendra <chandan@linux.vnet.ibm.com>,
	linux-unionfs@vger.kernel.org, eguan@redhat.com
Subject: [PATCH 1/2] src/t_dir_type.c: Use strtoul() instead of atoll()
Date: Mon, 13 Nov 2017 20:15:26 +0530	[thread overview]
Message-ID: <20171113144527.1034-1-chandan@linux.vnet.ibm.com> (raw)

An overlayfs filesystem instance with one lowerdir filesystem and with
"xino" mount option enabled can have the layer index encoded in the 63rd
bit of the inode number. A signed 64 bit integer won't suffice to store
this inode number. Hence this commit uses strtoul() to convert the inode
number in string form to unsigned integer form.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
 src/t_dir_type.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/t_dir_type.c b/src/t_dir_type.c
index 76aaa9b..7bba304 100644
--- a/src/t_dir_type.c
+++ b/src/t_dir_type.c
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
 				break;
 		/* no match ends up with type = -1 */
 		if (type < 0)
-			ino = atoll(argv[2]);
+			ino = strtoul(argv[2], NULL, 10);
 	}
 
 	for ( ; ; ) {
-- 
2.9.5

             reply	other threads:[~2017-11-13 14:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 14:45 Chandan Rajendra [this message]
2017-11-13 14:45 ` [PATCH 2/2] overlay: Test consistent st_ino numbers for non-samefs scenario Chandan Rajendra
2017-11-13 15:08   ` Amir Goldstein
2017-11-13 17:47   ` Amir Goldstein
2017-11-13 14:57 ` [PATCH 1/2] src/t_dir_type.c: Use strtoul() instead of atoll() Amir Goldstein
2017-11-14 11:13   ` Eryu Guan
2017-11-14 11:23     ` Amir Goldstein
2017-11-14 11:50       ` Eryu Guan

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=20171113144527.1034-1-chandan@linux.vnet.ibm.com \
    --to=chandan@linux.vnet.ibm.com \
    --cc=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@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).