From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbcB2VVA (ORCPT ); Mon, 29 Feb 2016 16:21:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:59374 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbcB2VU7 (ORCPT ); Mon, 29 Feb 2016 16:20:59 -0500 Date: Mon, 29 Feb 2016 22:21:19 +0100 From: Jan Kara To: Tejun Heo Cc: Al Viro , Tahsin Erdogan , Jan Kara , Jens Axboe , cgroups@vger.kernel.org, "Theodore Ts'o" , Nauman Rafique , linux-kernel@vger.kernel.org, Jan Kara Subject: Re: [PATCH block/for-linus] writeback: flush inode cgroup wb switches instead of pinning super_block Message-ID: <20160229212119.GH6174@quack.suse.cz> References: <20160217205721.GE14140@quack.suse.cz> <20160217210744.GA6479@mtj.duckdns.org> <20160217223009.GN14140@quack.suse.cz> <20160217230231.GC6479@mtj.duckdns.org> <20160229204724.GV3965@htj.duckdns.org> <20160229205428.GB17997@ZenIV.linux.org.uk> <20160229205837.GX3965@htj.duckdns.org> <20160229210614.GC17997@ZenIV.linux.org.uk> <20160229210800.GY3965@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160229210800.GY3965@htj.duckdns.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 29-02-16 16:08:00, Tejun Heo wrote: > On Mon, Feb 29, 2016 at 09:06:15PM +0000, Al Viro wrote: > > > Hmmm? The flushing is done after shrink_dcache_for_umount() and > > > sync_filesystems(). Aren't inodes supposed to stay clean after that? > > > > s/shrink_dcache_for_umount/fsnotify_unmount_inodes/ - sorry. > > Is that allowed to dirty indoes and initiate writebacks again, after > sync_filesystems() is done? That sounds weird but it's trivial to > move cgroup_writeback_umount() below that if so. Hardly, but generally it is true that filesystem may still dirty something (e.g. from outstanding workqueue work, but most likely some special "system inodes" may still become dirty) until ->put_super() is finished. Anyway, to make this foolproof, I'd just avoid queueing any new switching work after S_ACTIVE is cleared on the superblock and flush the workqueue just before evict_inodes() call. Honza -- Jan Kara SUSE Labs, CR