linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RFC]ext4 on 4k-sector drives without read-modify-write support
@ 2011-02-26 18:24 Ibragimov Rinat
  2011-02-28 14:52 ` Jeff Moyer
  0 siblings, 1 reply; 18+ messages in thread
From: Ibragimov Rinat @ 2011-02-26 18:24 UTC (permalink / raw)
  To: linux-fsdevel

I have a proposal about 4k-sector hard drives support in fs drivers.
Toshiba MK1231GAL is an 1.8" LIF IDE drive. It has 4096-byte physical
and 512-byte logical sectors [1]. Unlike others drives with Advanced
Format, it has not read-modify-write logic, so it can only operate
with 4k blocks. Fortunately some filesystems in linux (I tested jfs, 
reiserfs and btrfs) read and write data by 4096-byte blocks. But 
when I tried to mount ext4, it fails:

[ 2595.093595] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[ 2595.097302] ata2.00: BMDMA stat 0x5
[ 2595.100427] ata2.00: failed command: READ DMA
[ 2595.103191] ata2.00: cmd c8/00:02:02:c0:d1/00:00:00:00:00/ed tag 0 dma 1024 in
[ 2595.103196]          res 51/10:02:02:c0:d1/00:00:00:00:00/ed Emask 0x81 (invalid argument)
[ 2595.108796] ata2.00: status: { DRDY ERR }
[ 2595.111981] ata2.00: error: { IDNF }
[ 2595.128438] ata2.00: configured for UDMA/100
[ 2595.131964] ata2: EH complete


Before ext4 reads superblock it calls `sb_min_blocksize', remembers its value and
then use it. By default it returns 1024 (=EXT4_MIN_BLOCK_SIZE).
I propose to return physical block size instead of logical one. With such change 
filesystems that honor `sb_min_blocksize' return value are able to mount and operate.
(At least ext2/3/4, hfs and hfsplus.)
For 512-byte drives nothing changes.

Is such approach correct?


diff -ur linux-2.6.37-rc5-orig/fs/block_dev.c linux-2.6.37-rc5/fs/block_dev.c
--- linux-2.6.37-rc5-orig/fs/block_dev.c	2010-12-07 04:09:04.000000000 +0000
+++ linux-2.6.37-rc5/fs/block_dev.c	2010-12-15 20:11:19.311387630 +0000
@@ -121,7 +121,7 @@
 
 int sb_min_blocksize(struct super_block *sb, int size)
 {
-	int minsize = bdev_logical_block_size(sb->s_bdev);
+	int minsize = bdev_physical_block_size(sb->s_bdev);
 	if (size < minsize)
 		size = minsize;
 	return sb_set_blocksize(sb, size);


Please add linux-fsdevel@ to CC list, I'm subscribed to it only.

[1] http://storage.toshiba.eu/cms/en/hdd/multimedia/product_detail.jsp?productid=258




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

end of thread, other threads:[~2012-09-27 12:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-26 18:24 [PATCH][RFC]ext4 on 4k-sector drives without read-modify-write support Ibragimov Rinat
2011-02-28 14:52 ` Jeff Moyer
2011-02-28 14:58   ` Martin K. Petersen
2011-02-28 18:09     ` Ted Ts'o
2011-02-28 20:19       ` Martin K. Petersen
2011-02-28 21:05         ` Ted Ts'o
2011-02-28 21:10           ` Jeff Moyer
2011-02-28 21:22             ` Ted Ts'o
2011-02-28 21:57               ` Jeff Moyer
2011-03-01 15:19                 ` Martin K. Petersen
2011-02-28 21:20           ` James Bottomley
2011-02-28 21:24             ` Ted Ts'o
2011-02-28 21:23           ` Martin K. Petersen
2011-02-28 22:52       ` [PATCH][RFC]ext4 on 4k-sector drives without read-modify-writesupport Ibragimov Rinat
2011-03-01 22:16       ` Ibragimov Rinat
2011-03-10 17:01         ` Ibragimov Rinat
2011-02-28 17:54   ` [PATCH][RFC]ext4 on 4k-sector drives without read-modify-write support Ibragimov Rinat
2012-09-27 11:41     ` Mike

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).