From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCH] writeback: skip new or to-be-freed inodes Date: Tue, 09 Jun 2009 10:03:56 +0300 Message-ID: <4A2E095C.6070603@gmail.com> References: <20090324120502.GC23439@duck.suse.cz> <20090324124001.GA25326@localhost> <4A244A5B.7070605@sandeen.net> <20090602085523.GC7161@localhost> <20090602113736.GB15010@duck.suse.cz> <20090603141021.GB5738@localhost> <20090603141636.GC5650@duck.suse.cz> <20090603144711.GC5738@localhost> <20090606030725.GA12852@localhost> <4A2CB7AE.6080909@gmail.com> <20090608092930.GA13846@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jan Kara , Eric Sandeen , Andrew Morton , LKML , Masayoshi MIZUMA , "linux-fsdevel@vger.kernel.org" , "viro@zeniv.linux.org.uk" , Nick Piggin , Jeff Layton To: Wu Fengguang Return-path: Received: from smtp.nokia.com ([192.100.122.230]:42257 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbZFIHEx (ORCPT ); Tue, 9 Jun 2009 03:04:53 -0400 In-Reply-To: <20090608092930.GA13846@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Wu Fengguang wrote: > Hi Artem, >=20 > On Mon, Jun 08, 2009 at 03:03:10PM +0800, Artem Bityutskiy wrote: >> Wu Fengguang wrote: >>> The above race and warning didn't turn up because writeback_inodes(= ) holds >>> the s_umount lock, so generic_forget_inode() finds MS_ACTIVE and re= turns >>> early. But we are not sure the UBIFS calls and future callers will = guarantee >>> that. So skip I_WILL_FREE inodes for the sake of safety. >> The inode states are a bit vague for me, but vs. UBIFS - feel >> free to ask questions. >=20 > Thank you. Basically I'm not sure if UBIFS guarantees it won't be > unmounted (hence the MS_ACTIVE bit is on) when calling > generic_sync_sb_inodes() in shrink_liability() and ubifs_sync_fs(). To be frank my VFS knowledge is not good enough to give you a good answer. MS_ACTIVE seems to be set by file-systems when they are mounted, and cleaned by VFS when unmounting. I guess MS_ACTIVE is used by FS-es to check whether unmounting is in progress or not. Anyway, UBIFS does not use it. The generic_sync_sb_inodes() is called only from within VFS operations, e.g., from ->create, ->rename, ->mknod, ->write_begin, ->setattr, etc. I mean, it is called from UBIFS implementations of the above calls. UBIFS never calls generic_sync_sb_inodes() function by itself, e.g., from the UBIFS background thread. Also, all calls to generic_sync_sb_inodes() are from within VFS operations which need writing, e.g., VFS called 'mnt_want_write()' for all of them. I think VFS must protect the FS from being unmunted while it is in the middle of an operation, right? I'm just not sure how this mechanism works. This would mean that yes, we cannot be unmounted while we are in generic_sync_sb_inodes() called by UBIFS. Did this help :-) ? --=20 Best Regards, Artem Bityutskiy (=D0=90=D1=80=D1=82=D1=91=D0=BC =D0=91=D0=B8=D1=82=D1=8E= =D1=86=D0=BA=D0=B8=D0=B9) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html