[PATCH] Btrfs-progs: use atoll() for mkfs.btrfs size option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 32 bit systems, a numerical parameter of 2147483648 or above to
the mkfs.btrfs -b option does not work. The parameter is stored in
an u64 but is read using atol() and thus not read correctly.
This patch changes it to use atoll().
Specifying a multiplier (k, m or g) like "100g" in the mkfs.btrfs
parameter list would also be a working workaround.

Signed-off-by: Stefan Behrens <sbehrens@xxxxxxxxxxxxxxxx>
---
The patch is based on the master branch of
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git

 mkfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs.c b/mkfs.c
index 47f0c9c..e62f0e4 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -80,7 +80,7 @@ static u64 parse_size(char *s)
 		}
 		s[len - 1] = '\0';
 	}
-	ret = atol(s) * mult;
+	ret = atoll(s) * mult;
 	free(s);
 	return ret;
 }
-- 
1.7.12.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux