]> git.baikalelectronics.ru Git - kernel.git/commit
fs/minix: bugfix, number of indirect block ptrs per block depends on block size
authorErik van der Kouwe <vdkouwe@cs.vu.nl>
Wed, 26 May 2010 10:03:23 +0000 (12:03 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 28 May 2010 02:06:22 +0000 (22:06 -0400)
commitfb09325225f07ea24777b76bd26bddf479e6214f
tree1fbdea741219bb9d7a2beafe99084f9c2089af75
parent8975c2681864629997412021c53d0f0ac18d4728
fs/minix: bugfix, number of indirect block ptrs per block depends on block size

The MINIX filesystem driver used a constant number of indirect block
pointers in an indirect block. This worked only for filesystems with 1kb
block, while the MINIX default block size is now 4kb. As a consequence,
large files were read incorrectly on such filesystems and writing a
large file would cause the filesystem to become corrupted. This patch
computes the number of indirect block pointers based on the block size,
making the driver work for each block size.

I would like to thank Feiran Zheng ('Fam') for pointing out the cause
of the corruption.

Signed-off-by: Erik van der Kouwe <vdkouwe@cs.vu.nl>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/minix/itree_v2.c