linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tab@snarc.org (Vincent Hanquez)
To: Greg KH <gregkh@suse.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>, linux-kernel@vger.kernel.org
Subject: Re: [BUG] debugfs: hard link count wrong
Date: Fri, 27 Jan 2006 18:43:33 +0100	[thread overview]
Message-ID: <20060127174332.GA19649@snarc.org> (raw)
In-Reply-To: <20060127071749.GA13924@suse.de>

On Thu, Jan 26, 2006 at 11:17:49PM -0800, Greg KH wrote:
> I'm running 4.3.0, not 4.2.30.  I don't know where it came from either,
> gentoo's unstable tree has it, and caused me to download it from
> somewhere when I built it :)

looks like all fs that use simple_fill_super got a root inode with
i_nlink=1 at the start of day.

I've compared with shmem, the nlink is incremented to 2 by a call to
shmem_get_inode, when filling_super.

I've test the following patch with debugfs and securityfs, and its
seems to cure the problem.

------

Fix incorrect nlink of root inode for filesystems that use simple_fill_super

Signed-off-by: Vincent Hanquez <vincent@snarc.org>

diff -Naur a/fs/libfs.c a/fs/libfs.c
--- a/fs/libfs.c	2006-01-03 03:21:10.000000000 +0000
+++ b/fs/libfs.c	2006-01-27 17:43:31.000000000 +0000
@@ -388,6 +388,7 @@
 	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 	inode->i_op = &simple_dir_inode_operations;
 	inode->i_fop = &simple_dir_operations;
+	inode->i_nlink = 2;
 	root = d_alloc_root(inode);
 	if (!root) {
 		iput(inode);


  reply	other threads:[~2006-01-27 17:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26 14:11 [BUG] debugfs: hard link count wrong Heiko Carstens
2006-01-27  3:25 ` Greg KH
2006-01-27  5:56   ` Heiko Carstens
2006-01-27  6:38     ` Greg KH
2006-01-27  7:04       ` Heiko Carstens
2006-01-27  7:17         ` Greg KH
2006-01-27 17:43           ` Vincent Hanquez [this message]
2006-01-30  6:51             ` Heiko Carstens
2006-02-01 12:08             ` Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060127174332.GA19649@snarc.org \
    --to=tab@snarc.org \
    --cc=gregkh@suse.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).