All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode
@ 2011-11-28  7:47 Jeff Liu
  2011-11-29  0:08 ` David Sterba
  2011-11-29  6:04 ` Jeff Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Jeff Liu @ 2011-11-28  7:47 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

For an initial dir inode, stat(1) show it links as 1, IMHO it should be
2 by default.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>

---
 fs/btrfs/inode.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 116ab67..92b3cb9 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4734,6 +4734,7 @@ static int btrfs_mkdir(struct inode *dir, struct
dentry *dentry, int mode)
 	inode->i_op = &btrfs_dir_inode_operations;
 	inode->i_fop = &btrfs_dir_file_operations;

+	set_nlink(inode, 2);
 	btrfs_i_size_write(inode, 0);
 	err = btrfs_update_inode(trans, root, inode);
 	if (err)
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-30  2:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28  7:47 [PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode Jeff Liu
2011-11-29  0:08 ` David Sterba
2011-11-29  6:04 ` Jeff Liu
2011-11-29 15:48   ` Chris Mason
2011-11-29 16:10     ` Jan Schmidt
2011-11-30  2:12     ` Jeff Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.