src/t_dir_type.c: Use strtoul() instead of atoll()
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Mon, 13 Nov 2017 14:45:26 +0000 (20:15 +0530)
committerEryu Guan <eguan@redhat.com>
Tue, 14 Nov 2017 11:56:21 +0000 (19:56 +0800)
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>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
src/t_dir_type.c

index 76aaa9bb4b731d47523385286dd0a6f43a7df14a..7bba3043e941a398267012c70acbecb4c1c2caa4 100644 (file)
@@ -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 ( ; ; ) {