From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Fernandes Subject: bread problem Date: Thu, 13 Aug 2009 22:04:56 -0700 Message-ID: <9ff7a3bc0908132204h53ec122bo5afd9f5f7da26d58@mail.gmail.com> References: <9ff7a3bc0908132152g694a2009r9007aed59428f892@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from rv-out-0506.google.com ([209.85.198.232]:59966 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753625AbZHNFLc (ORCPT ); Fri, 14 Aug 2009 01:11:32 -0400 Received: by rv-out-0506.google.com with SMTP id k40so45737rvb.5 for ; Thu, 13 Aug 2009 22:11:33 -0700 (PDT) In-Reply-To: <9ff7a3bc0908132152g694a2009r9007aed59428f892@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, I'm trying to read a block from disk by block_nr using __bread before the block has even been written to disk. The problem in doing this is the block is cached (junk data) and future sb_bread's return the buffer head from this cache, and not one that represent the actual data after this data has been written to disk. 1. block contains junk 2. bread -> cached junk 3. actual data written to disk through the address space object hosted by some other inode 4. bread -> still returns bh with junk Is there any way to force a read from disk while doing the second bread, or to instruct the kernel that the block that's in the cache has to be re-read? Thanks, Joel