fuse: set i_nlink to sane value after mount
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 17 Oct 2007 06:31:02 +0000 (23:31 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:43:04 +0000 (08:43 -0700)
Aufs seems to depend on a positive i_nlink value.  So fill in a dummy but sane
value for the root inode at mount time.

The inode attributes are refreshed with the correct values at the first
opportunity.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

fs/fuse/inode.c

index e8d360a..951e760 100644 (file)
@@ -472,6 +472,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode)
 
        attr.mode = mode;
        attr.ino = FUSE_ROOT_ID;
+       attr.nlink = 1;
        return fuse_iget(sb, 1, 0, &attr);
 }