From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751228AbcFDUD2 (ORCPT ); Sat, 4 Jun 2016 16:03:28 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35469 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146AbcFDUDZ (ORCPT ); Sat, 4 Jun 2016 16:03:25 -0400 Date: Sat, 4 Jun 2016 21:03:15 +0100 From: Salah Triki To: Al Viro Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] fs: befs: Increment i_count when inode is found Message-ID: <20160604200315.GA21661@pc> References: <20160604193242.GB14480@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160604193242.GB14480@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 04, 2016 at 08:32:42PM +0100, Al Viro wrote: > On Sat, Jun 04, 2016 at 07:53:21PM +0100, Salah Triki wrote: > > As VFS expects, i_count field is incremented when the named inode is found. > > VFS expects no such thing. Incidentally, you have neither bothered to > check other filesystems nor cared to look at fs/inode.c. OK, suppose you > have found a huge multi-filesystem bug - such things happen from time to > time. But you have not even bothered to test your conjecture; this "fix" > had never been tried or even compiled. > > What actually happens is that iget_locked() acquires a reference to inode. > That reference is either dropped by iget_failed() (called by befs_iget() > in case of failure to read and initialized the sucker) or used up by > d_add() as a reference to hold dentry->d_inode. > > Similar situation holds for other filesystems; they do not need to manipulate > i_count at all. thanks for your comments