+2005-05-20 Theodore Ts'o <tytso@mit.edu>
+
+ * filefrag.c (frag_report, get_bmap): The FIBMAP and FIGETBSZ
+ ioctls return an integer, not an unsigned long. Fix this
+ to avoid problems on 64-bit platforms where the size of an
+ integer != the size of a long. (Addresses Debian Bug
+ #309655)
+
2005-05-09 Theodore Ts'o <tytso@mit.edu>
* util.c (figure_journal_size): Change the default journal size to
static unsigned long get_bmap(int fd, unsigned long block)
{
int ret;
- unsigned long b;
+ unsigned int b;
b = block;
- ret = ioctl(fd, FIBMAP, &b);
+ ret = ioctl(fd, FIBMAP, &b); /* FIBMAP takes a pointer to an integer */
if (ret < 0) {
if (errno == EPERM) {
fprintf(stderr, "No permission to use FIBMAP ioctl; must have root privileges\n");
{
struct statfs fsinfo;
struct stat64 fileinfo;
- long i, fd, bs, block, last_block = 0, numblocks;
+ int bs;
+ long i, fd, block, last_block = 0, numblocks;
long bpib; /* Blocks per indirect block */
long cylgroups;
int discont = 0, expected;
perror("open");
return;
}
- if (ioctl(fd, FIGETBSZ, &bs) < 0) {
+ if (ioctl(fd, FIGETBSZ, &bs) < 0) { /* FIGETBSZ takes an int */
perror("FIGETBSZ");
close(fd);
return;