[PATCH] debugfs: hard link count wrong
authorVincent Hanquez <[email protected]>
Fri, 3 Feb 2006 11:04:48 +0000 (03:04 -0800)
committerLinus Torvalds <[email protected]>
Fri, 3 Feb 2006 16:32:11 +0000 (08:32 -0800)
Fix incorrect nlink of root inode for filesystems that use
simple_fill_super().

Signed-off-by: Vincent Hanquez <[email protected]>
Cc: Greg KH <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/libfs.c

index 63c020e6589e5c81e296f2eae3b9a2e5917aeee0..71fd08fa410301deef23dcc563f9232c92081fa9 100644 (file)
@@ -388,6 +388,7 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
        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);