All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode
Date: Tue, 29 Nov 2011 14:04:37 +0800	[thread overview]
Message-ID: <4ED475F5.1090500@oracle.com> (raw)
In-Reply-To: <4ED33C88.8060501@oracle.com>

Please ignore this patch for now, it can cause the file system corrupted
and failed to mount again, sorry for the noise!

-Jeff
On 11/28/2011 03:47 PM, Jeff Liu wrote:

> 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)



  parent reply	other threads:[~2011-11-29  6:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-11-29 15:48   ` Chris Mason
2011-11-29 16:10     ` Jan Schmidt
2011-11-30  2:12     ` Jeff Liu

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=4ED475F5.1090500@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=linux-btrfs@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 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.