aboutsummaryrefslogtreecommitdiffstats
path: root/fs/minix/inode.c
diff options
context:
space:
mode:
authorQi Yong <qiyong@fc-cn.com>2014-08-08 17:20:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:20 -0400
commit6d6747f85314687f72012ae85cde401db531e130 (patch)
treeda2c90e980961139efe805e820f0fdb1d0a61b57 /fs/minix/inode.c
parent9f7d7a1d0f36bed7f533807146483e8fdfe12a89 (diff)
minix zmap block counts calculation fix
The original minix zmap blocks calculation was correct, in the formula of: sbi->s_nzones - sbi->s_firstdatazone + 1 It is sp->s_zones - (sp->s_firstdatazone - 1) in the minix3 source code. But a later commit 016e8d44bc06 ("fs/minix: Verify bitmap block counts before mounting") has changed it unfortunately as: sbi->s_nzones - (sbi->s_firstdatazone + 1) This would show free blocks one block less than the real when the total data blocks are in "full zmap blocks plus one". This patch corrects that zmap blocks calculation and tidy a printk message while at it. Signed-off-by: Qi Yong <qiyong@fc-cn.com> Cc: Josh Boyer <jwboyer@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/minix/inode.c')
-rw-r--r--fs/minix/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index f007a3355570..3f57af196a7d 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -267,12 +267,12 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)
267 block = minix_blocks_needed(sbi->s_ninodes, s->s_blocksize); 267 block = minix_blocks_needed(sbi->s_ninodes, s->s_blocksize);
268 if (sbi->s_imap_blocks < block) { 268 if (sbi->s_imap_blocks < block) {
269 printk("MINIX-fs: file system does not have enough " 269 printk("MINIX-fs: file system does not have enough "
270 "imap blocks allocated. Refusing to mount\n"); 270 "imap blocks allocated. Refusing to mount.\n");
271 goto out_no_bitmap; 271 goto out_no_bitmap;
272 } 272 }
273 273
274 block = minix_blocks_needed( 274 block = minix_blocks_needed(
275 (sbi->s_nzones - (sbi->s_firstdatazone + 1)), 275 (sbi->s_nzones - sbi->s_firstdatazone + 1),
276 s->s_blocksize); 276 s->s_blocksize);
277 if (sbi->s_zmap_blocks < block) { 277 if (sbi->s_zmap_blocks < block) {
278 printk("MINIX-fs: file system does not have enough " 278 printk("MINIX-fs: file system does not have enough "