From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: fs: page cache wrongly left invalidated after revalidate_disk Date: Wed, 24 Oct 2012 16:39:03 -0700 Message-ID: <20121024163903.2a5bb819.akpm@linux-foundation.org> References: <28086318.27561350944959337.herumi@nifty.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: MITSUNARI Shigeo , linux-fsdevel@vger.kernel.org, Alexander Viro , linux-kernel@vger.kernel.org, Jens Axboe To: Jeff Moyer Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, 24 Oct 2012 09:44:23 -0400 Jeff Moyer wrote: > MITSUNARI Shigeo writes: > > > Hi, > > > > We found that bdev->bd_invalidated was left set once revalidate_disk() > > is called, which results in page cache flush every time that device > > is open. > > > > Specifically, we found this problem in MD block device. Once we > > resize a MD device, mdadm --monitor periodically flush all page cache > > for that device every 60 or 1000 seconds when it opens the device. > > > > This bug lies since at least 3.2.0 till the latest kernel(3.6.2). > > Patch is attached. > > > > Anyone please review this? Thanks in advance. > > rescan_partitions (called in the bdev open path) should reset > bd_invalidated. I think you need to dig into why that isn't happening. I suspect it's because I_NEW is no longer set on the inode. I queued this one for some viro attention ;)