From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754885AbcBHQfa (ORCPT ); Mon, 8 Feb 2016 11:35:30 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38501 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751929AbcBHQf2 (ORCPT ); Mon, 8 Feb 2016 11:35:28 -0500 Date: Mon, 8 Feb 2016 08:35:27 -0800 From: Greg Kroah-Hartman To: Roman Peniaev Cc: "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 1/3] debugfs: fix automount inode i_nlink references Message-ID: <20160208163527.GA10778@kroah.com> References: <1449751634-7887-1-git-send-email-r.peniaev@gmail.com> <1449751634-7887-2-git-send-email-r.peniaev@gmail.com> <20160208063851.GB12507@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Feb 08, 2016 at 11:28:52AM +0100, Roman Peniaev wrote: > On Mon, Feb 8, 2016 at 7:38 AM, Greg Kroah-Hartman > wrote: > > On Thu, Dec 10, 2015 at 01:47:12PM +0100, Roman Pen wrote: > >> Directory inodes should start off with i_nlink == 2 (for "." entry). > >> Of course the same rule should be applied to automount dentries for > >> child and parent inodes as well. > >> > >> Also now automount dentry does fsnotify_mkdir. > >> > >> Without this patch kernel complains when sees i_nlink == 0: > > > > How can the kernel see this? What did you do to trigger this? > > Yes, sorry, I had to be more precise on this. > That happens on unlinking of automount dentry. > > Easily can be reproduced: > > autom = debugfs_create_automount("automount", parentd, vfsmount_cb, data); > BUG_ON(IS_ERR_OR_NULL(autom)); > debugfs_remove(autom); > > You will immediately see one warning on attempt to drop_nlink() (which is zero) > for automount dentry. Why don't we see this "in the wild" today with the one user of this function? > The second warning happens when you unlink 'parentd', because > debugfs_create_automount() did not increase the nlink for parent > inode. > > Do I need to resend this patch with more precise description? Yes, please fix up and resend as a stand-alone patch, as it is independant of your other proposal. And take off the "RFC" marking, I can never apply a patch with that type of marking as you obviously don't think it is good enough to be merged, so why would I? :) thanks, greg k-h