linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug? in using generic read/write functions to read/write block devices  in 2.4.11-pre2
@ 2001-10-03 12:17 Vladimir V. Saveliev
  2001-10-03 13:16 ` [PATCH] " Alexander Viro
  2001-10-03 21:09 ` Buffer cache confusion? Re: [reiserfs-list] bug? in using generic read/write functions to read/write block devices in 2.4.11-pre2 Eric Whiting
  0 siblings, 2 replies; 28+ messages in thread
From: Vladimir V. Saveliev @ 2001-10-03 12:17 UTC (permalink / raw)
  To: linux-kernel, reiserfs-list

Hi

It looks like something wrong happens with writing/reading to block
device using generic read/write functions when one does:

mke2fs /dev/hda1 (blocksize is 4096)
mount /dev/hda1
umount /dev/hda1
mke2fs /dev/hda1 - FAILS with
Warning: could not write 8 blocks in inode table starting at 492004:
Attempt to write block from filesystem resulted in short write

(note that /dev/hda1 should be big enough - 3gb is enogh for example)


Explanation of what happens (could be wrong and unclear):

blocksize of /dev/hda1 was 1024. So, /dev/hda1's inode->i_blkbits is set
to 10.
mount-ing used set_blocksize() to change blocksize to 4096 in
blk_size[][].
But inode of /dev/hda1 still has i_blkbits which makes
block_prepare_write to create buffers of 1024 bytes and call
blkdev_get_block for each of them.
fs/block_dev.c:/max_block calculates number of blocks on the device
using blk_size[][] and thinks that there are 4 times less blocks on the
device.

Thanks,
vs

PS: thanks to Elena <grev@namesys.botik.ru> for finding that



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2001-10-08 19:39 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-03 12:17 bug? in using generic read/write functions to read/write block devices in 2.4.11-pre2 Vladimir V. Saveliev
2001-10-03 13:16 ` [PATCH] " Alexander Viro
2001-10-03 16:18   ` Linus Torvalds
2001-10-03 21:43     ` Alexander Viro
2001-10-03 21:56       ` Christoph Hellwig
2001-10-03 22:51         ` Alexander Viro
2001-10-03 19:55           ` Whining about 2.5 (was Re: [PATCH] Re: bug? in using generic read/write functions to read/write block devices in 2.4.11-pre2) Rob Landley
2001-10-04  0:38             ` Rik van Riel
2001-10-03 22:27               ` Rob Landley
2001-10-04 20:53                 ` Whining about 2.5 (was Re: [PATCH] Re: bug? in using generic read/write functions to read/write block devices in 2.4.11-pre2O Alan Cox
2001-10-04 23:59                   ` Whining about NUMA. :) [Was whining about 2.5...] Rob Landley
2001-10-05 14:51                     ` Alan Cox
2001-10-08 17:57                       ` Martin J. Bligh
2001-10-08 18:10                         ` Alan Cox
2001-10-08 18:20                           ` Martin J. Bligh
2001-10-08 18:31                             ` Alan Cox
2001-10-08 18:35                             ` Jesse Barnes
2001-10-08 18:55                               ` Martin J. Bligh
2001-10-08 17:48                                 ` Marcelo Tosatti
2001-10-08 19:20                                   ` Martin J. Bligh
2001-10-08 19:12                                 ` Jesse Barnes
2001-10-08 19:37                                   ` Peter Rival
2001-10-04 23:39                 ` NUMA & classzones (was Whining about 2.5) Martin J. Bligh
2001-10-04 23:55                   ` Rob Landley
2001-10-05 17:29                     ` Martin J. Bligh
2001-10-06  1:44                     ` Jesse Barnes
2001-10-04 21:02             ` Whining about 2.5 (was Re: [PATCH] Re: bug? in using generic read/write functions to read/write block devices in 2.4.11-pre2) Alan Cox
2001-10-03 21:09 ` Buffer cache confusion? Re: [reiserfs-list] bug? in using generic read/write functions to read/write block devices in 2.4.11-pre2 Eric Whiting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).