From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin Jambor" Subject: Shouldn't unmap_underlying_metadata() mark buffers not uptodate? Date: Sun, 7 May 2006 17:13:58 +0200 Message-ID: <9615ac9b0605070813n3cda5d5fx43567bb25d22341f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7BIT Return-path: Received: from wx-out-0102.google.com ([66.249.82.199]:46389 "EHLO wx-out-0102.google.com") by vger.kernel.org with ESMTP id S932158AbWEGPN7 convert rfc822-to-8bit (ORCPT ); Sun, 7 May 2006 11:13:59 -0400 Received: by wx-out-0102.google.com with SMTP id t16so729795wxc for ; Sun, 07 May 2006 08:13:58 -0700 (PDT) To: "Linux FS Development List" Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, we are developing a filesystem that writes data to disk in a manner similar to mpage_writepages(). At the same time, the data can be read back using bread(). Today we have encountered a situation where we were reading old data. When we had a look at the disk with hexedit we also saw old data and only after a reboot we saw the last stuff that was written to the blocks in question. Apparently, the reads were fulfilled with cached data in bdev mapping that were no longer actually up to date. We have managed to get rid of the problem when we implemented our own version of unmap_underlying_metadata that also marked the buffer and page in question as not up to date. So our questions are: a) is this likely to happen in other filesystems using mpage_writepages()? If not, why? For example, when you read a block directly from the block device, then filesystem's mpage_writepages() overwrites it and finally you read that same block from the device again, is it possible that you read the old data again? b) shouldn't unmap_underlying_metadata() therefore clear the buffers uptodate flag? c) or is there some other kernel (preferably exported :-) function that we should use? TIA Martin