Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751023AbVJJXeW (ORCPT ); Mon, 10 Oct 2005 19:34:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751036AbVJJXeW (ORCPT ); Mon, 10 Oct 2005 19:34:22 -0400 Received: from artax.karlin.mff.cuni.cz ([195.113.31.125]:43490 "EHLO artax.karlin.mff.cuni.cz") by vger.kernel.org with ESMTP id S1751023AbVJJXeV (ORCPT ); Mon, 10 Oct 2005 19:34:21 -0400 Date: Tue, 11 Oct 2005 01:34:20 +0200 (CEST) From: Mikulas Patocka To: Glauber de Oliveira Costa Cc: Anton Altaparmakov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ext2-devel@lists.sourceforge.net, hirofumi@mail.parknet.co.jp, linux-ntfs-dev@lists.sourceforge.net, aia21@cantab.net, hch@infradead.org, viro@zeniv.linux.org.uk, akpm@osdl.org Subject: Re: [PATCH] Use of getblk differs between locations In-Reply-To: <20051010233344.GA13399@br.ibm.com> Message-ID: References: <20051010204517.GA30867@br.ibm.com> <20051010214605.GA11427@br.ibm.com> <20051010231242.GC11427@br.ibm.com> <20051010233344.GA13399@br.ibm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1367 Lines: 33 >>>> What should a filesystem driver do if it can't suddenly read or write any >>>> blocks on media? >>> >>> Maybe stopping gracefully, warn about what happened, and let the system >>> keep going. You may be right about your main filesystem, but in the case >>> I'm running, for example, my system in an ext3 filesystem, and have a >>> vfat from a usb key. Should my system really hang because I'm not able >>> to read/write to the device? >> >> getblk won't fail because of I/O error --- it can fail only because of >> memory management bugs. I think it's right to stop the system in that case >> --- it's better than silently corrupting data on any device. >> >> Mikulas >> > In the code, we see: > > if (unlikely(size & (bdev_hardsect_size(bdev)-1) || > (size < 512 || size > PAGE_SIZE))) { > > This is where __getblk_slow, and thus, __getblk fails, and it does not > seem to be due to any memory management bug. This is a filesystem bug --- filesystem should set it's blocksize with sb_set_blocksize (and refuse to mount if the device doesn't support it) before using it in requests. Mikulas - 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/