From: Miao Xie <miaox@cn.fujitsu.com>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Cc: Mark Fasheh <mfasheh@suse.de>
Subject: [PATCH 1/2] Btrfs: set the INCOMPAT_EXTENDED_IREF when the extended iref is inserted
Date: Thu, 11 Apr 2013 18:33:31 +0800 [thread overview]
Message-ID: <5166917B.5040606@cn.fujitsu.com> (raw)
In-Reply-To: <51669144.20107@cn.fujitsu.com>
We needn't set the INCOMAT_EXTENDED_IREF when making a new fs, just
do it after we insert a extended iref successfully. Otherwise, we
can not mount the fs in which there is no extended iref in fact on
the old kernel, it is not so flexible for the users.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Cc: Mark Fasheh <mfasheh@suse.de>
---
fs/btrfs/inode-item.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 48b8fda..f07eb45 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -443,15 +443,15 @@ out:
btrfs_free_path(path);
if (ret == -EMLINK) {
- struct btrfs_super_block *disk_super = root->fs_info->super_copy;
- /* We ran out of space in the ref array. Need to
- * add an extended ref. */
- if (btrfs_super_incompat_flags(disk_super)
- & BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)
- ret = btrfs_insert_inode_extref(trans, root, name,
- name_len,
- inode_objectid,
- ref_objectid, index);
+ /*
+ * We ran out of space in the ref array. Need to add an
+ * extended ref.
+ */
+ ret = btrfs_insert_inode_extref(trans, root, name, name_len,
+ inode_objectid, ref_objectid,
+ index);
+ if (!ret)
+ btrfs_set_fs_incompat(root->fs_info, EXTENDED_IREF);
}
return ret;
--
1.8.0.1
next prev parent reply other threads:[~2013-04-11 10:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 10:32 [PATCH 0/2] do not open the extend inode reference at the beginning Miao Xie
2013-04-11 10:33 ` Miao Xie [this message]
2013-04-11 10:35 ` [PATCH 2/2] Btrfs: introduce noextiref mount option Miao Xie
2013-04-11 14:29 ` Jan Schmidt
2013-04-12 4:13 ` Miao Xie
2013-04-12 7:02 ` Jan Schmidt
2013-04-15 2:58 ` Miao Xie
2013-04-15 5:25 ` Jan Schmidt
2013-04-15 5:36 ` Wang Shilong
2013-04-12 17:01 ` Eric Sandeen
2013-04-15 16:59 ` Mark Fasheh
2013-04-15 17:20 ` David Sterba
2013-04-25 11:27 ` Miao Xie
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=5166917B.5040606@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mfasheh@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox