From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbdEPW1v (ORCPT ); Tue, 16 May 2017 18:27:51 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750812AbdEPW1s (ORCPT ); Tue, 16 May 2017 18:27:48 -0400 Subject: Re: Question on fscrypt_d_revalidate() and fstest generic/429 To: Eric Biggers References: <20170515194553.GA20264@gmail.com> <489e1437-990f-3e88-d426-b47b82441009@nod.at> <20170515232556.GA46783@gmail.com> <20170516220709.GB113464@gmail.com> Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel , Eric Biggers , "Theodore Ts'o" , Al Viro , David Gstir , David Oberhollenzer , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , Artem Bityutskiy , Adrian Hunter From: Richard Weinberger Message-ID: <76ca65df-8ffb-97b8-50ca-29f22ecf7c34@nod.at> Date: Wed, 17 May 2017 00:27:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170516220709.GB113464@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eric, Am 17.05.2017 um 00:07 schrieb Eric Biggers: >>> I can reproduce this on an unencrypted directory after updating path_init() in >>> fs/namei.c to always clear LOOKUP_RCU, so that all path lookups are done in >>> ref-walk mode. So I think fscrypt_d_revalidate() was only relevant because it >>> causes all path lookups to drop out of rcu-walk mode. >> >> On ext4 or UBIFS? > > Both; the inode "leak" isn't filesystem-specific, beyond the fact that UBIFS > apparently limits the number of inodes on its orphan list while ext4 does not. > (How do I know it happens on ext4 then? /proc/slabinfo shows that lots of ext4 > inodes have been allocated, and after an unclean shutdown and remounting, it's > reported that 50,000+ orphan inodes were deleted.) UBIFS's orphan list is limited by the size of a LEB (logical erase block). With nandsim's default settings such a LEB is rather small and can store only 2k orphans. > There are lots of cases in which path lookups switch from rcu-walk mode into > ref-walk mode, so the fact that it was being caused by ->d_revalidate() in this > specific situation isn't really important, IMO. > > I think the actual fix would be something along the lines of making vfs_rmdir() > unhash any negative child dentries, so that they get "killed" by dput() later. Thanks, //richard