]> Zhao Yanbai Git Server - minix.git/commitdiff
isofs: fix reported st_blocks stat(2) field 13/3413/1
authorDavid van Moolenbroek <david@minix3.org>
Sun, 26 Feb 2017 22:18:21 +0000 (22:18 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Sun, 26 Feb 2017 22:22:20 +0000 (22:22 +0000)
The st_blocks field should count 512-byte units, not file system
block units.  The previous computation would cause utilities such
as du(1), when used on isofs, to be off by a factor four.

Change-Id: If47c234079d19bd5b41f35a97780667efd822509

minix/fs/isofs/inode.c

index 595ad897ccef268c042ec793574de170b05bd4e7..f9b197f634a329584ea1f1af7e2f8f8a4f653509 100644 (file)
@@ -325,8 +325,7 @@ void read_inode_iso9660(struct inode_dir_entry *i,
        /* Initialize stat. */
        i->i_node->i_stat.st_dev = fs_dev;
        i->i_node->i_stat.st_blksize = v_pri.logical_block_size_l;
-       i->i_node->i_stat.st_blocks =
-           dir_rec->data_length_l / v_pri.logical_block_size_l;
+       i->i_node->i_stat.st_blocks = dir_rec->data_length_l / 512;
        i->i_node->i_stat.st_nlink = 1;
 }