From: Andrew Morton Subject: Re: What happens to pages that failed to be written to disk? Date: Thu, 28 Jul 2005 00:33:26 -0700 Message-ID: <20050728003326.4add1a0f.akpm@osdl.org> References: <8e70aacf05072717125bfc1c58@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from smtp.osdl.org ([65.172.181.4]:17588 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S261317AbVG1He2 (ORCPT ); Thu, 28 Jul 2005 03:34:28 -0400 To: Martin Jambor In-Reply-To: <8e70aacf05072717125bfc1c58@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Martin Jambor wrote: > > Hi, > > I have tried to find out how filesystems are supposed to handle the > situation when an asynchronous writeout of a page fails and so had a > look at the ext2 code. All I have found is that for example > mpage_end_io_write sets the Error flag of both the page and its > mapping... and that is about it. yup. > What happens to these pages later on? They get reclaimed without being written. > Does the memory manager attempt to write them again? No. Because if the error persists the machine will run out of memory in a fatal manner. > Is the error > somehow signalled to anyone? Yes, it's propagated into the file's address_space for a later fsync()/fdatasync()/msync() to detect. > Do filesystems try to relocate the data > from bad blocks of the device? Nope. Disks will do that internally. If a disk gets a write I/O error it's generally dead. Nowadays I/O errors generally arise from storage networks when something in the network is disrupted. Possibly our behaviour is wrong in that case, although it could be argued that the retry logic should be implemented at the storage layer and not the VFS layer. The out-of-memory problem is a killer.