From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Cc: bfoster@redhat.com
Subject: [PATCH 2/6] xfs: add some comments to xfs_iext_insert/xfs_iext_insert_node
Date: Thu, 9 Nov 2017 14:26:52 +0100 [thread overview]
Message-ID: <20171109132656.1649-3-hch@lst.de> (raw)
In-Reply-To: <20171109132656.1649-1-hch@lst.de>
Reported-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/xfs/libxfs/xfs_iext_tree.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_iext_tree.c b/fs/xfs/libxfs/xfs_iext_tree.c
index 85d7f708eafc..c28a24aca9c5 100644
--- a/fs/xfs/libxfs/xfs_iext_tree.c
+++ b/fs/xfs/libxfs/xfs_iext_tree.c
@@ -525,6 +525,10 @@ xfs_iext_insert_node(
if (nr_entries == KEYS_PER_NODE)
new = xfs_iext_split_node(&node, &pos, &nr_entries);
+ /*
+ * Update the pointers in higher levels if the first entry changes
+ * in an existing node.
+ */
if (node != new && pos == 0 && nr_entries > 0)
xfs_iext_update_node(ifp, node->keys[0], offset, level, node);
@@ -643,6 +647,10 @@ xfs_iext_insert(
if (nr_entries == RECS_PER_LEAF)
new = xfs_iext_split_leaf(cur, &nr_entries);
+ /*
+ * Update the pointers in higher levels if the first entry changes
+ * in an existing node.
+ */
if (cur->leaf != new && cur->pos == 0 && nr_entries > 0) {
xfs_iext_update_node(ifp, xfs_iext_leaf_key(cur->leaf, 0),
offset, 1, cur->leaf);
--
2.14.2
next prev parent reply other threads:[~2017-11-09 13:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 13:26 incore extent b+tree fixups Christoph Hellwig
2017-11-09 13:26 ` [PATCH 1/6] xfs: fix number of records handling in xfs_iext_split_leaf Christoph Hellwig
2017-11-09 13:26 ` Christoph Hellwig [this message]
2017-11-09 13:26 ` [PATCH 3/6] xfs: remove a superflous assignment in xfs_iext_remove_node Christoph Hellwig
2017-11-09 13:26 ` [PATCH 4/6] xfs: trivial indentation fixup for xfs_iext_remove_node Christoph Hellwig
2017-11-09 13:26 ` [PATCH 5/6] xfs: add comments documenting the rebalance algorithm Christoph Hellwig
2017-11-09 13:26 ` [PATCH 6/6] xfs: handle zero entries case in xfs_iext_rebalance_leaf Christoph Hellwig
2017-11-09 14:32 ` incore extent b+tree fixups Brian Foster
2017-11-10 1:11 ` Darrick J. Wong
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=20171109132656.1649-3-hch@lst.de \
--to=hch@lst.de \
--cc=bfoster@redhat.com \
--cc=linux-xfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).