Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 8 Nov 2002 15:47:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 8 Nov 2002 15:47:25 -0500 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:17425 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Fri, 8 Nov 2002 15:47:24 -0500 To: linux-kernel@vger.kernel.org From: torvalds@transmeta.com (Linus Torvalds) Subject: Re: [BUG] Failed writes marked clean? Date: Fri, 8 Nov 2002 20:53:56 +0000 (UTC) Organization: Transmeta Corporation Message-ID: References: <3DCC1EB5.4020303@google.com> X-Trace: palladium.transmeta.com 1036788835 14654 127.0.0.1 (8 Nov 2002 20:53:55 GMT) X-Complaints-To: news@transmeta.com NNTP-Posting-Date: 8 Nov 2002 20:53:55 GMT Cache-Post-Path: palladium.transmeta.com!unknown@penguin.transmeta.com X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 25 In article <3DCC1EB5.4020303@google.com>, Ross Biro wrote: > >Perhaps I'm reading the code incorrectly, but in kernel versions 2.4.18 >and 2.5.46 it looks to me like in the case of a write, ll_rw_block >always clears the dirty bit. In the event of an error, nothing resets >the dirty bit and the uptodate flag is cleared. Correct. There's not all that much else it could do. Keeping the dirty bit set is not an option - that would bring the whole system down on IO errors. As it is, higher layers that care _can_ figure the IO error out, simply by noticing that the page is not up-to-date after the write. It's then totally up to the higher layers (ie user space) to write the thing anew if it cares about the data. (In other words: this is why we have fsync() and error codes). Linus - 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/