lkml.org 
[lkml]   [2006]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [BUG] debugfs: hard link count wrong
    > 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);
    >
    > -

    Works fine for me. Is the patch ok, Greg?

    Thanks,
    Heiko
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-01-30 07:54    [W:0.021 / U:30.436 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site