From: Jan Kara Subject: Re: Lazytime feature bugs Date: Tue, 24 Feb 2015 19:31:03 +0100 Message-ID: <20150224183103.GA13024@quack.suse.cz> References: <20150218131931.GA10424@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Alexander Viro , Linus Torvalds To: tytso@mit.edu Return-path: Received: from cantor2.suse.de ([195.135.220.15]:53455 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752769AbbBXSbI (ORCPT ); Tue, 24 Feb 2015 13:31:08 -0500 Content-Disposition: inline In-Reply-To: <20150218131931.GA10424@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, any reaction here? Honza On Wed 18-02-15 14:19:31, Jan Kara wrote: > I had a look at what got merged as a lazytime series from Ted and I have > found a couple of issues (I think I've pointed them out in my emails back > in November but admittedly things were somewhat confused back then since > Ted was submitting new versions pretty fast). Anyway here are the issues > I've found in the merged code: > > 1) Inode that gets periodically dirtied with I_DIRTY_PAGES, cleaned and > dirtied again will have inode with updated timestamps never written due > to age since inode->dirtied_when gets reset on each redirtying with > I_DIRTY_PAGES. > 2) The code won't maintain time ordering of b_dirty_time list by > inode->dirtied_when - this happens because requeue_inode() moves inode > at the head of the b_dirty_time list but inodes in b_io list from which > we move are no longer ordered by dirtied_when (due to that list being > combined from several lists and also because we sort the list by > superblock). As a result terminating logic in move_expired_inodes() may > terminate the scan too early for b_dirty_time list. > 3) This is mostly cosmetic currently but is a potential landmine for > future: If you dirty with I_DIRTY_PAGES | I_DIRTY_TIME inode gets filed > to b_dirty_time list instead of b_dirty list. > 4) Another mostly cosmetic issue: move_expired_inodes() should use > work->for_sync instead of work->reason == WB_REASON_SYNC (work->reason is > there only for tracing purposes). -- Jan Kara SUSE Labs, CR