From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] Btrfs-progs: mkfs: make sure we can deal with hard links with -r option
Date: Thu, 13 Mar 2014 19:24:47 +0800 [thread overview]
Message-ID: <5321957F.7070104@cn.fujitsu.com> (raw)
In-Reply-To: <20140312162151.GB6782@twin.jikos.cz>
Hi Dave,
On 03/13/2014 12:21 AM, David Sterba wrote:
> On Tue, Mar 11, 2014 at 06:29:09PM +0800, Wang Shilong wrote:
>> @@ -840,6 +833,10 @@ static int traverse_directory(struct btrfs_trans_handle *trans,
>> cur_file->d_name, cur_inum,
>> parent_inum, dir_index_cnt,
>> &cur_inode);
>> + if (ret == -EEXIST) {
>> + BUG_ON(st.st_nlink <= 1);
> As the mkfs operation is restartable, can we handle the error?
This should be a logic error which means a inode has hard links(but
links <= 1). :-)
Add error handling may be better, i will update it.
Thanks,
Wang
>
> Otherwise, good fix, thanks.
>
>> + continue;
>> + }
>> if (ret) {
>> fprintf(stderr, "add_inode_items failed\n");
>> goto fail;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2014-03-13 11:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 10:29 [PATCH 1/2] Btrfs-progs: mkfs: don't create extent for an empty file Wang Shilong
2014-03-11 10:29 ` [PATCH 2/2] Btrfs-progs: mkfs: make sure we can deal with hard links with -r option Wang Shilong
2014-03-12 16:21 ` David Sterba
2014-03-13 11:24 ` Wang Shilong [this message]
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=5321957F.7070104@cn.fujitsu.com \
--to=wangsl.fnst@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--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.