From: David van Moolenbroek Date: Sun, 26 Feb 2017 22:18:21 +0000 (+0000) Subject: isofs: fix reported st_blocks stat(2) field X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/datamaps.china.min.js?a=commitdiff_plain;h=8d0759b089e4b67dfcc7cc954724c4da7bb25a87;p=minix.git isofs: fix reported st_blocks stat(2) field 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 --- diff --git a/minix/fs/isofs/inode.c b/minix/fs/isofs/inode.c index 595ad897c..f9b197f63 100644 --- a/minix/fs/isofs/inode.c +++ b/minix/fs/isofs/inode.c @@ -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; }