From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751427AbcFDTcx (ORCPT ); Sat, 4 Jun 2016 15:32:53 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:46322 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbcFDTct (ORCPT ); Sat, 4 Jun 2016 15:32:49 -0400 Date: Sat, 4 Jun 2016 20:32:42 +0100 From: Al Viro To: Salah Triki 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: <20160604193242.GB14480@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.