From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anton Altaparmakov Subject: Re: What happens to pages that failed to be written to disk? Date: Sat, 30 Jul 2005 22:13:00 +0100 (BST) Message-ID: References: <8e70aacf05072717125bfc1c58@mail.gmail.com> <20050728003326.4add1a0f.akpm@osdl.org> <8e70aacf050730124739a9382@mail.gmail.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Andrew Morton , linux-fsdevel@vger.kernel.org Return-path: Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]:41927 "EHLO ppsw-9.csi.cam.ac.uk") by vger.kernel.org with ESMTP id S262817AbVG3VNI (ORCPT ); Sat, 30 Jul 2005 17:13:08 -0400 To: Martin Jambor In-Reply-To: <8e70aacf050730124739a9382@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, 30 Jul 2005, Martin Jambor wrote: > Hi and thanks for all answers. > > On 7/28/05, Andrew Morton wrote: > > > 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. > > I see, so a subsequent sync, fsync or umount fail with an error even > when the writing that failed was not initiated because of them? > > > > 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. > > I am not interested in what happens in HW, I strive to write a filesystem :-) > Anyway, I see that a write error probably does not happen because of > bad blocks anyway but because something even worse happened and > therefore there is no point in it even though our filesystem would be > able to relocate stuff fairly easily. Am I right? It can and does happen due to bad blocks. The drive only relocates up to a certain number (until its spare blocks run out) then defetive blocks start appearing on disk. We (NTFS developers) have seen a lot of users with disks with bad blocks on them. And Windows NTFS does relocation so when a write fails it relocates the data block and repeats the write. So if your filesystem can do the same then it is definitely worth doing. The argument that once you start seing bad sectors the disk is going to be dead soon is wrong as many examples in the field have shown. As Szaka said it is just like dead pixels on LCD screens. The drive can develop a certain number and then stop and then work happily for many years. Best regards, Anton -- Anton Altaparmakov (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/