Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 11 Dec 2001 06:31:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 11 Dec 2001 06:30:51 -0500 Received: from ikura.fe.dis.titech.ac.jp ([131.112.171.65]:32386 "HELO ikura.fe.dis.titech.ac.jp") by vger.kernel.org with SMTP id ; Tue, 11 Dec 2001 06:30:47 -0500 Date: Tue, 11 Dec 2001 20:30:40 +0900 Message-ID: From: GOTO Masanori To: viro@math.psu.edu Cc: gotom@debian.org, torvalds@transmeta.com, marcelo@conectiva.com.br, linux-kernel@vger.kernel.org, andrea@suse.de Subject: Re: [PATCH] direct IO breaks root filesystem In-Reply-To: In your message of "Tue, 11 Dec 2001 04:13:06 -0500 (EST)" In-Reply-To: User-Agent: Wanderlust/2.2.15 (More Than Words) EMIKO/1.13.9 (Euglena tripteris) FLIM/1.13.2 (Kasanui) APEL/10.2 MULE XEmacs/21.1 (patch 10) (Capitol Reef) (i386-debian-linux) MIME-Version: 1.0 (generated by EMIKO 1.13.9 - "Euglena tripteris") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Tue, 11 Dec 2001 04:13:06 -0500 (EST), Alexander Viro wrote: > > + /* > > + * If inode is BLK and it is not already mounted, > > + * blocksize change hardsect_size. > > + */ > > + if (S_ISBLK(inode->i_mode) && !is_mounted(inode->i_rdev)) { > > That's obviously wrong. What's to stop it from getting mounted > right after that check? Ah! You're right. I was confused, I'm sorry. New patch is here (and works well)... Ugh. --- linux-2.4.17-pre8.vanilla/mm/filemap.c Tue Dec 11 15:54:57 2001 +++ linux-2.4.17-pre8/mm/filemap.c Tue Dec 11 19:36:09 2001 @@ -1508,8 +1508,21 @@ new_iobuf = 1; } - blocksize = 1 << inode->i_blkbits; - blocksize_bits = inode->i_blkbits; + /* + * If inode is block device, blocksize is set as hardsect_size. + */ + if (S_ISBLK(inode->i_mode)) { + int size; + + size = get_hardsect_size(inode->i_rdev); + blocksize = size; + for (blocksize_bits = 0; !(size & 1); ) + size >>= 1, blocksize_bits++; + } else { + blocksize = 1 << inode->i_blkbits; + blocksize_bits = inode->i_blkbits; + } + blocksize_mask = blocksize - 1; chunk_size = KIO_MAX_ATOMIC_IO << 10; -- gotom - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/