]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
minix zmap block counts calculation fix
authorQi Yong <qiyong@fc-cn.com>
Fri, 8 Aug 2014 21:20:29 +0000 (14:20 -0700)
committerJiri Slaby <jslaby@suse.cz>
Wed, 3 Dec 2014 10:58:43 +0000 (11:58 +0100)
commit692f067fb661c39cc800ae7407ab655173ca2de2
tree0a5bccfdf9bc49de4da5c888093b2a15b7433cd1
parent0d68992fb4250d00a906ee886ec541a6afeab066
minix zmap block counts calculation fix

commit 6d6747f85314687f72012ae85cde401db531e130 upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/minix/bitmap.c
fs/minix/inode.c